Class: ConstantContact::Components::EventSpot::RegistrantPromoCode

Inherits:
Component
  • Object
show all
Defined in:
lib/constantcontact/components/event_spot/registrant_promo_code.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#promo_code_infoObject

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_discountObject

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

Parameters:

  • props (Hash)
    • hash of properties to create object from

Returns:



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