Class: Mycommands::Param
- Inherits:
-
Object
- Object
- Mycommands::Param
- Defined in:
- lib/mycommands/models/param.rb
Instance Attribute Summary collapse
-
#substituted ⇒ Object
readonly
Returns the value of attribute substituted.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(param) ⇒ Param
constructor
A new instance of Param.
- #substitute(input) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(param) ⇒ Param
Returns a new instance of Param.
32 33 34 |
# File 'lib/mycommands/models/param.rb', line 32 def initialize param @param = param end |
Instance Attribute Details
#substituted ⇒ Object (readonly)
Returns the value of attribute substituted.
30 31 32 |
# File 'lib/mycommands/models/param.rb', line 30 def substituted @substituted end |
Instance Method Details
#description ⇒ Object
36 37 38 |
# File 'lib/mycommands/models/param.rb', line 36 def description @param.values.flatten.first.to_s end |
#substitute(input) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/mycommands/models/param.rb', line 44 def substitute input if input.empty? and description.include? "(" input = description[/\((.*?)\)/, 1] end @substituted = input end |
#value ⇒ Object
40 41 42 |
# File 'lib/mycommands/models/param.rb', line 40 def value @param.keys.first.to_s end |