Class: Spout::Models::Option
- Inherits:
-
Object
- Object
- Spout::Models::Option
- Defined in:
- lib/spout/models/option.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#missing ⇒ Object
Returns the value of attribute missing.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #deploy_params ⇒ Object
-
#initialize(option_hash) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(option_hash) ⇒ Option
Returns a new instance of Option.
8 9 10 11 12 |
# File 'lib/spout/models/option.rb', line 8 def initialize(option_hash) %w(display_name value description missing).each do |method| instance_variable_set("@#{method}", (option_hash.is_a?(Hash) ? option_hash : {})[method]) end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/spout/models/option.rb', line 6 def description @description end |
#display_name ⇒ Object
Returns the value of attribute display_name.
6 7 8 |
# File 'lib/spout/models/option.rb', line 6 def display_name @display_name end |
#missing ⇒ Object
Returns the value of attribute missing.
6 7 8 |
# File 'lib/spout/models/option.rb', line 6 def missing @missing end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/spout/models/option.rb', line 6 def value @value end |
Instance Method Details
#deploy_params ⇒ Object
14 15 16 17 |
# File 'lib/spout/models/option.rb', line 14 def deploy_params { display_name: display_name, value: value, description: description, missing: missing } end |