Class: CommandMapper::Gen::OptionValue

Inherits:
Arg
  • Object
show all
Defined in:
lib/command_mapper/gen/option_value.rb

Instance Attribute Summary

Attributes inherited from Arg

#required, #type

Instance Method Summary collapse

Methods inherited from Arg

#initialize

Constructor Details

This class inherits a constructor from CommandMapper::Gen::Arg

Instance Method Details

#to_rubyString

Converts the parsed option to Ruby source code.

Returns:

  • (String)


13
14
15
16
17
18
19
# File 'lib/command_mapper/gen/option_value.rb', line 13

def to_ruby
  ruby = super()

  if ruby.empty? then "true"
  else                "{#{ruby}}"
  end
end