Class: ConstantContact::Components::Registrant

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

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#attendance_statusObject

Returns the value of attribute attendance_status



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def attendance_status
  @attendance_status
end

#emailObject

Returns the value of attribute email



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def first_name
  @first_name
end

#guest_countObject

Returns the value of attribute guest_count



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def guest_count
  @guest_count
end

#guestsObject

Returns the value of attribute guests



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def guests
  @guests
end

#idObject

Returns the value of attribute id



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def id
  @id
end

#last_nameObject

Returns the value of attribute last_name



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def last_name
  @last_name
end

#payment_statusObject

Returns the value of attribute payment_status



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def payment_status
  @payment_status
end

#payment_summaryObject

Returns the value of attribute payment_summary



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def payment_summary
  @payment_summary
end

#promo_codeObject

Returns the value of attribute promo_code



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def promo_code
  @promo_code
end

#registration_dateObject

Returns the value of attribute registration_date



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def registration_date
  @registration_date
end

#registration_statusObject

Returns the value of attribute registration_status



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def registration_status
  @registration_status
end

#sectionsObject

Returns the value of attribute sections



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def sections
  @sections
end

#ticket_idObject

Returns the value of attribute ticket_id



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def ticket_id
  @ticket_id
end

#updated_dateObject

Returns the value of attribute updated_date



10
11
12
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10

def updated_date
  @updated_date
end

Class Method Details

.create(props) ⇒ Registrant

Factory method to create an event Registrant object from a hash

Parameters:

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

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 17

def self.create(props)
  obj = Registrant.new
  if props
    props.each do |key, value|
      key = key.to_s
      if key == 'payment_summary'
        obj.payment_summary = Components::EventSpot::PaymentSummary.create(value)
      elsif key == 'sections'
        obj.sections = value.collect{|section| Components::EventSpot::RegistrantSection.create(section) }
      elsif key == 'promo_code'
        obj.promo_code = Components::EventSpot::RegistrantPromoCode.create(value)
      elsif key == 'guests'
        value = value["guest_info"] || []
        obj.guests = value.collect{|guest| Components::EventSpot::Guest.create(guest) }
      else
        obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
      end
    end
  end
  obj
end

.create_summary(props) ⇒ Registrant

Factory method to create an event Registrant summary object from a hash

Parameters:

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

Returns:



42
43
44
45
46
47
48
49
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 42

def self.create_summary(props)
  obj = Registrant.new
  props.each do |key, value|
    key = key.to_s
    obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
  end if props
  obj
end