class ConstantContact::Components::EventSpot::RegistrantSection

Attributes

fields[RW]
label[RW]

Public Class Methods

create(props) click to toggle source

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

# File lib/constantcontact/components/event_spot/registrant_section.rb, line 16
def self.create(props)
  obj = RegistrantSection.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