Class: ConstantContact::Components::Registrant
- Defined in:
- lib/constantcontact/components/event_spot/registrant.rb
Instance Attribute Summary collapse
-
#attendance_status ⇒ Object
Returns the value of attribute attendance_status.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#guest_count ⇒ Object
Returns the value of attribute guest_count.
-
#guests ⇒ Object
Returns the value of attribute guests.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#payment_status ⇒ Object
Returns the value of attribute payment_status.
-
#payment_summary ⇒ Object
Returns the value of attribute payment_summary.
-
#promo_code ⇒ Object
Returns the value of attribute promo_code.
-
#registration_date ⇒ Object
Returns the value of attribute registration_date.
-
#registration_status ⇒ Object
Returns the value of attribute registration_status.
-
#sections ⇒ Object
Returns the value of attribute sections.
-
#ticket_id ⇒ Object
Returns the value of attribute ticket_id.
-
#updated_date ⇒ Object
Returns the value of attribute updated_date.
Class Method Summary collapse
-
.create(props) ⇒ Registrant
Factory method to create an event Registrant object from a hash.
-
.create_summary(props) ⇒ Registrant
Factory method to create an event Registrant summary object from a hash.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#attendance_status ⇒ Object
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 |
#email ⇒ Object
Returns the value of attribute email
10 11 12 |
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10 def email @email end |
#first_name ⇒ Object
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_count ⇒ Object
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 |
#guests ⇒ Object
Returns the value of attribute guests
10 11 12 |
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10 def guests @guests end |
#id ⇒ Object
Returns the value of attribute id
10 11 12 |
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10 def id @id end |
#last_name ⇒ Object
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_status ⇒ Object
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_summary ⇒ Object
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_code ⇒ Object
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_date ⇒ Object
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_status ⇒ Object
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 |
#sections ⇒ Object
Returns the value of attribute sections
10 11 12 |
# File 'lib/constantcontact/components/event_spot/registrant.rb', line 10 def sections @sections end |
#ticket_id ⇒ Object
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_date ⇒ Object
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
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
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 |