Class: ConstantContact::Components::EventSpot::SaleItem

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

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#amountObject

Returns the value of attribute amount



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

def amount
  @amount
end

#fee_period_typeObject

Returns the value of attribute fee_period_type



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

def fee_period_type
  @fee_period_type
end

#idObject

Returns the value of attribute id



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

def id
  @id
end

#nameObject

Returns the value of attribute name



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

def name
  @name
end

#promo_typeObject

Returns the value of attribute promo_type



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

def promo_type
  @promo_type
end

#quantityObject

Returns the value of attribute quantity



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

def quantity
  @quantity
end

#typeObject

Returns the value of attribute type



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

def type
  @type
end

Class Method Details

.create(props) ⇒ SaleItem

Factory method to create a SaleItem 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
# File 'lib/constantcontact/components/event_spot/sale_item.rb', line 16

def self.create(props)
  obj = SaleItem.new
  if props
    props.each do |key, value|
      key = key.to_s
      obj.send("#{key}=", value) if obj.respond_to? key
    end
  end
  obj
end