Class: RProgram::Argument
- Inherits:
-
Object
- Object
- RProgram::Argument
- Defined in:
- lib/rprogram/argument.rb
Instance Method Summary collapse
-
#arguments(value) ⇒ Array
Formats a value into an Array of arguments.
Instance Method Details
#arguments(value) ⇒ Array
Formats a value into an Array of arguments.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rprogram/argument.rb', line 13 def arguments(value) value = case value when Hash value.map do |key,sub_value| if sub_value == true then key.to_s elsif sub_value then "#{key}=#{sub_value}" end end when false, nil [] else Array(value) end return value.compact end |