Revision af19cdc5
Added by Marc Dequènes over 15 years ago
- ID af19cdc59052827405ad1a56e347687caba69f41
lib/ldap_shadows/display_utils.rb | ||
---|---|---|
module Display
|
||
def self.display_fields(attr_data, options = {})
|
||
attr_data.each_pair do |key, val|
|
||
next if attr_data[:expert] and options[:expert]
|
||
next if val[:expert] and not options[:expert]
|
||
|
||
field_name = Translator.translate_field_name(key)
|
||
|
||
... | ... | |
end
|
||
end
|
||
|
||
def self.display_item_list(title, item_list)
|
||
def self.display_item_list(title, item_list, options)
|
||
puts "=== #{title} (#{item_list.size}) ==="
|
||
item_list.each do |item|
|
||
str = item.human_name
|
||
str += " [#{item.name}]" if $program_options[:handles]
|
||
str += " [#{item.name}]" if options[:handles]
|
||
str += ": #{item.description}" unless item.description.empty?
|
||
puts str
|
||
end
|
Also available in: Unified diff
[fix] code cleanup and a few fixes