class ConstantContact::Components::Registrant

Attributes

attendance_status[RW]
email[RW]
first_name[RW]
guest_count[RW]
guests[RW]
id[RW]
last_name[RW]
payment_status[RW]
payment_summary[RW]
promo_code[RW]
registration_date[RW]
registration_status[RW]
sections[RW]
ticket_id[RW]
updated_date[RW]

Public Class Methods

create(props) click to toggle source

Factory method to create an event Registrant object from a hash @param [Hash] props - hash of properties to create object from @return [Registrant]

# 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) click to toggle source

Factory method to create an event Registrant summary object from a hash @param [Hash] props - hash of properties to create object from @return [Registrant]

# 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