Class: ConstantContact::Components::EventSpot::RegistrantPromoCode
- Inherits:
-
Component
- Object
- Component
- ConstantContact::Components::EventSpot::RegistrantPromoCode
- Defined in:
- lib/constantcontact/components/event_spot/registrant_promo_code.rb
Instance Attribute Summary collapse
-
#promo_code_info ⇒ Object
Returns the value of attribute promo_code_info.
-
#total_discount ⇒ Object
Returns the value of attribute total_discount.
Class Method Summary collapse
-
.create(props) ⇒ RegistrantPromoCode
Factory method to create a RegistrantPromoCode object from a hash.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#promo_code_info ⇒ Object
Returns the value of attribute promo_code_info
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_promo_code.rb', line 11 def promo_code_info @promo_code_info end |
#total_discount ⇒ Object
Returns the value of attribute total_discount
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_promo_code.rb', line 11 def total_discount @total_discount end |
Class Method Details
.create(props) ⇒ RegistrantPromoCode
Factory method to create a RegistrantPromoCode object from a hash
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/constantcontact/components/event_spot/registrant_promo_code.rb', line 16 def self.create(props) obj = RegistrantPromoCode.new props.each do |key, value| key = key.to_s if key == 'promo_code_info' obj.send("#{key}=", Components::EventSpot::RegistrantPromoCodeInfo.create(value)) else obj.send("#{key}=", value) if obj.respond_to? key end end if props obj end |