Class: ConstantContact::Components::EventSpot::RegistrantSection
- Inherits:
-
Component
- Object
- Component
- ConstantContact::Components::EventSpot::RegistrantSection
- Defined in:
- lib/constantcontact/components/event_spot/registrant_section.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#label ⇒ Object
Returns the value of attribute label.
Class Method Summary collapse
-
.create(props) ⇒ RegistrantSection
Factory method to create a RegistrantSection object from a hash.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_section.rb', line 11 def fields @fields end |
#label ⇒ Object
Returns the value of attribute label
11 12 13 |
# File 'lib/constantcontact/components/event_spot/registrant_section.rb', line 11 def label @label end |
Class Method Details
.create(props) ⇒ RegistrantSection
Factory method to create a RegistrantSection object from a hash
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# 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 |