Class: ConstantContact::Components::EventSpot::PaymentSummary

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

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#orderObject

Returns the value of attribute order



11
12
13
# File 'lib/constantcontact/components/event_spot/payment_summary.rb', line 11

def order
  @order
end

#payment_statusObject

Returns the value of attribute payment_status



11
12
13
# File 'lib/constantcontact/components/event_spot/payment_summary.rb', line 11

def payment_status
  @payment_status
end

#payment_typeObject

Returns the value of attribute payment_type



11
12
13
# File 'lib/constantcontact/components/event_spot/payment_summary.rb', line 11

def payment_type
  @payment_type
end

#promo_codeObject

Returns the value of attribute promo_code



11
12
13
# File 'lib/constantcontact/components/event_spot/payment_summary.rb', line 11

def promo_code
  @promo_code
end

Class Method Details

.create(props) ⇒ PaymentSummary

Factory method to create an event PaymentSummary 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
28
29
# File 'lib/constantcontact/components/event_spot/payment_summary.rb', line 16

def self.create(props)
  obj = PaymentSummary.new
  props.each do |key, value|
    key = key.to_s
    if key == 'order'
      obj.order = Components::EventSpot::RegistrantOrder.create(value)
    elsif key == 'promo_code'
      obj.promo_code = Components::EventSpot::RegistrantPromoCode.create(value)
    else
      obj.send("#{key}=", value) if obj.respond_to? key
    end
  end if props
  obj
end