Class: Crowdskout::Components::Option
- Defined in:
- lib/crowdskout/components/attributes/option.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
-
.create(props) ⇒ Option
Factory method to create an Option object from a json string.
Methods inherited from Component
get_value, #to_hash, to_hash_value, #to_json
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/crowdskout/components/attributes/option.rb', line 10 def id @id end |
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/crowdskout/components/attributes/option.rb', line 10 def value @value end |
Class Method Details
.create(props) ⇒ Option
Factory method to create an Option object from a json string
15 16 17 18 19 20 21 22 23 |
# File 'lib/crowdskout/components/attributes/option.rb', line 15 def self.create(props) obj = Option.new if props props.each do |key, value| obj.send("#{key}=", value) if obj.respond_to? key end end obj end |