Class: ConstantContact::Components::EventItem
- Defined in:
- lib/constantcontact/components/event_spot/event_item.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#default_quantity_available ⇒ Object
Returns the value of attribute default_quantity_available.
-
#default_quantity_total ⇒ Object
Returns the value of attribute default_quantity_total.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#per_registrant_limit ⇒ Object
Returns the value of attribute per_registrant_limit.
-
#price ⇒ Object
Returns the value of attribute price.
-
#show_quantity_available ⇒ Object
Returns the value of attribute show_quantity_available.
Class Method Summary collapse
-
.create(props) ⇒ EventItem
Factory method to create an EventItem object from a hash.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def attributes @attributes end |
#default_quantity_available ⇒ Object
Returns the value of attribute default_quantity_available
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def default_quantity_available @default_quantity_available end |
#default_quantity_total ⇒ Object
Returns the value of attribute default_quantity_total
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def default_quantity_total @default_quantity_total end |
#description ⇒ Object
Returns the value of attribute description
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def description @description end |
#id ⇒ Object
Returns the value of attribute id
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def id @id end |
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def name @name end |
#per_registrant_limit ⇒ Object
Returns the value of attribute per_registrant_limit
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def per_registrant_limit @per_registrant_limit end |
#price ⇒ Object
Returns the value of attribute price
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def price @price end |
#show_quantity_available ⇒ Object
Returns the value of attribute show_quantity_available
10 11 12 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 10 def show_quantity_available @show_quantity_available end |
Class Method Details
.create(props) ⇒ EventItem
Factory method to create an EventItem object from a hash
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/constantcontact/components/event_spot/event_item.rb', line 16 def self.create(props) obj = EventItem.new if props props.each do |key, value| if key == 'attributes' if value obj.attributes = [] value.each do |attribute| obj.attributes << Components::EventItemAttribute.create(attribute) end end else obj.send("#{key}=", value) if obj.respond_to? key end end end obj end |