Class: Stackup::ParameterStruct
- Inherits:
-
Object
- Object
- Stackup::ParameterStruct
- Defined in:
- lib/stackup/parameters.rb
Instance Attribute Summary collapse
-
#parameter_key ⇒ Object
(also: #key)
Returns the value of attribute parameter_key.
-
#parameter_value ⇒ Object
Returns the value of attribute parameter_value.
-
#use_previous_value ⇒ Object
Returns the value of attribute use_previous_value.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ParameterStruct
constructor
A new instance of ParameterStruct.
- #value ⇒ Object
Constructor Details
#initialize(attributes) ⇒ ParameterStruct
Returns a new instance of ParameterStruct.
51 52 53 54 55 56 57 58 |
# File 'lib/stackup/parameters.rb', line 51 def initialize(attributes) attributes.each do |name, value| if name.respond_to?(:gsub) name = name.gsub(/([a-z])([A-Z])/, '\1_\2').downcase end public_send("#{name}=", value) end end |
Instance Attribute Details
#parameter_key ⇒ Object Also known as: key
Returns the value of attribute parameter_key.
60 61 62 |
# File 'lib/stackup/parameters.rb', line 60 def parameter_key @parameter_key end |
#parameter_value ⇒ Object
Returns the value of attribute parameter_value.
61 62 63 |
# File 'lib/stackup/parameters.rb', line 61 def parameter_value @parameter_value end |
#use_previous_value ⇒ Object
Returns the value of attribute use_previous_value.
62 63 64 |
# File 'lib/stackup/parameters.rb', line 62 def use_previous_value @use_previous_value end |
Instance Method Details
#value ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/stackup/parameters.rb', line 66 def value if use_previous_value :use_previous_value else parameter_value end end |