Class: ConstantContact::Components::EventSpot::Guest

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

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#guest_idObject

Returns the value of attribute guest_id



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

def guest_id
  @guest_id
end

#guest_sectionObject

Returns the value of attribute guest_section



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

def guest_section
  @guest_section
end

Class Method Details

.create(props) ⇒ Guest

Factory method to create a Guest 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/guest.rb', line 16

def self.create(props)
  obj = Guest.new
  props.each do |key, value|
    key = key.to_s
    if key == 'guest_section'
      obj.send("#{key}=", Components::EventSpot::GuestSection.create(value))
    else
      obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
    end
  end
  obj
end