Method: Loquacious::Configuration::Help#format_name
- Defined in:
- lib/loquacious/configuration/help.rb
#format_name(node, show_value) ⇒ Object
Format the name of the attribute pointed at by the given node. If the show_value flag is set to true, then the attribute value will also be included in the returned string.
199 200 201 202 203 204 205 206 207 208 |
# File 'lib/loquacious/configuration/help.rb', line 199 def format_name( node, show_value ) name = node.name.reduce @name_length return @name_format % name if node.config? or !show_value sio = StringIO.new PP.pp(node.obj, sio, @value_length) sio.seek 0 obj = sio.read.chomp.gsub("\n", @value_leader) @format % [name, obj] end |