Class: ConstantContact::Components::EventSpot::RegistrantOrder
- Inherits:
-
Component
- Object
- Component
- ConstantContact::Components::EventSpot::RegistrantOrder
- Defined in:
- lib/constantcontact/components/event_spot/registrant_order.rb
Instance Attribute Summary collapse
-
#currency_type ⇒ Object
Returns the value of attribute currency_type.
-
#fees ⇒ Object
Returns the value of attribute fees.
-
#items ⇒ Object
Returns the value of attribute items.
-
#order_date ⇒ Object
Returns the value of attribute order_date.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#total ⇒ Object
Returns the value of attribute total.
Class Method Summary collapse
-
.create(props) ⇒ RegistrantOrder
Factory method to create a RegistrantOrder object from a hash.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#currency_type ⇒ Object
Returns the value of attribute currency_type
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 11 def currency_type @currency_type end |
#fees ⇒ Object
Returns the value of attribute fees
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 11 def fees @fees end |
#items ⇒ Object
Returns the value of attribute items
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 11 def items @items end |
#order_date ⇒ Object
Returns the value of attribute order_date
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 11 def order_date @order_date end |
#order_id ⇒ Object
Returns the value of attribute order_id
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 11 def order_id @order_id end |
#total ⇒ Object
Returns the value of attribute total
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 11 def total @total end |
Class Method Details
.create(props) ⇒ RegistrantOrder
Factory method to create a RegistrantOrder object from a hash
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/constantcontact/components/event_spot/registrant_order.rb', line 16 def self.create(props) obj = RegistrantOrder.new props.each do |key, value| key = key.to_s if key == 'fees' value ||= [] obj.fees = value.collect do |fee| Components::EventSpot::RegistrantFee.create(fee) end elsif key == 'items' value ||= [] obj.items = value.collect do |item| Components::EventSpot::SaleItem.create(item) end else obj.send("#{key}=", value) if obj.respond_to? key end end if props obj end |