Sha256: a3941826f8e07fc0c9988833fef0c09de81907c419cbf5f30a5cfc145d5d703a

Contents?: true

Size: 915 Bytes

Versions: 11

Compression:

Stored size: 915 Bytes

Contents

#
# guest_section.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

module ConstantContact
  module Components
    module EventSpot
      class GuestSection < Component
        attr_accessor :label, :fields

        # Factory method to create a GuestSection object from a hash
        # @param [Hash] props - hash of properties to create object from
        # @return [GuestSection]
        def self.create(props)
          obj = GuestSection.new
          props.each do |key, value|
            key = key.to_s
            if key == 'fields'
              value ||= []
              obj.fields = value.collect do |field|
                Components::EventSpot::RegistrantField.create(field)
              end
            else
              obj.send("#{key}=", value) if obj.respond_to? key
            end
          end if props
          obj
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
constantcontact-4.0.0 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-3.0.0 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-2.2.1 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-ruby-2.2.1 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-ruby-2.2.0 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-2.2.0 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-2.1.0 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-2.0.1 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-2.0.0 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-1.3.2 lib/constantcontact/components/event_spot/guest_section.rb
constantcontact-1.2.0 lib/constantcontact/components/event_spot/guest_section.rb