lib/constantcontact/components/event_spot/guest.rb in constantcontact-1.1.2 vs lib/constantcontact/components/event_spot/guest.rb in constantcontact-1.2.0

- old
+ new

@@ -8,23 +8,23 @@ module Components module EventSpot class Guest < Component attr_accessor :guest_id, :guest_section - # Factory method to create an event Registrant object from a hash + # Factory method to create a Guest object from a hash # @param [Hash] props - hash of properties to create object from - # @return [Campaign] + # @return [Guest] def self.create(props) - guest = Guest.new + obj = Guest.new props.each do |key, value| key = key.to_s if key == 'guest_section' - guest.send("#{key}=", Components::EventSpot::RegistrantSection.create(value)) + obj.send("#{key}=", Components::EventSpot::GuestSection.create(value)) else - guest.send("#{key}=", value) if guest.respond_to?("#{key}=") + obj.send("#{key}=", value) if obj.respond_to?("#{key}=") end end - guest + obj end end end end end \ No newline at end of file