Class: CommandBuilder::ArgumentFormatter
- Inherits:
-
Object
- Object
- CommandBuilder::ArgumentFormatter
- Defined in:
- lib/command_builder_generator/lib/argument_formatter.rb
Instance Method Summary collapse
Instance Method Details
#format(argument, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/command_builder_generator/lib/argument_formatter.rb', line 8 def format(argument, ={}) formatter = case when argument.kind_of?(Array) ArrayArgumentFormatter.new [:delimiter] when argument.kind_of?(Hash) HashArgumentFormatter.new [:delimiter], [:key_value_separator] else StringArgumentFormatter.new end formatter.format argument end |