Class: Chouette::Command::Option

Inherits:
Object
  • Object
show all
Defined in:
app/models/chouette/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Option

Returns a new instance of Option.



68
69
70
# File 'app/models/chouette/command.rb', line 68

def initialize(key, value)
  @key, @value = key.to_s, value
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



66
67
68
# File 'app/models/chouette/command.rb', line 66

def key
  @key
end

#valueObject

Returns the value of attribute value.



66
67
68
# File 'app/models/chouette/command.rb', line 66

def value
  @value
end

Instance Method Details

#command_keyObject



72
73
74
# File 'app/models/chouette/command.rb', line 72

def command_key
  key.camelize(:lower) 
end

#to_sObject



76
77
78
79
80
81
82
# File 'app/models/chouette/command.rb', line 76

def to_s
  unless value == true
    "-#{command_key} #{value}"
  else
    "-#{command_key}"
  end
end