Module: Boson::OptionParser::API
- Included in:
- Boson::OptionParser
- Defined in:
- lib/boson/option_parser.rb
Instance Method Summary collapse
Instance Method Details
#get_fields_and_options(fields, options) ⇒ Object
276 277 278 279 |
# File 'lib/boson/option_parser.rb', line 276 def (fields, ) opts = fields [fields, opts] end |
#render_table(fields, arr, options) ⇒ Object
281 282 283 284 285 286 287 |
# File 'lib/boson/option_parser.rb', line 281 def render_table(fields, arr, ) headers = [:no_headers] ? [] : [['Name', 'Desc'], ['----', '----']] arr_of_arr = headers + arr.map do |row| [ row.values_at(:alias, :name).compact.join(', '), row[:desc].to_s ] end puts Util.format_table(arr_of_arr) end |