Class: ConstantContact::Components::Promocode

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

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#code_nameObject

Returns the value of attribute code_name



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def code_name
  @code_name
end

#code_typeObject

Returns the value of attribute code_type



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def code_type
  @code_type
end

#discount_amountObject

Returns the value of attribute discount_amount



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def discount_amount
  @discount_amount
end

#discount_percentObject

Returns the value of attribute discount_percent



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def discount_percent
  @discount_percent
end

#discount_scopeObject

Returns the value of attribute discount_scope



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def discount_scope
  @discount_scope
end

#discount_typeObject

Returns the value of attribute discount_type



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def discount_type
  @discount_type
end

#fee_idsObject

Returns the value of attribute fee_ids



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def fee_ids
  @fee_ids
end

#idObject

Returns the value of attribute id



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def id
  @id
end

#is_pausedObject

Returns the value of attribute is_paused



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def is_paused
  @is_paused
end

#quantity_availableObject

Returns the value of attribute quantity_available



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def quantity_available
  @quantity_available
end

#quantity_totalObject

Returns the value of attribute quantity_total



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def quantity_total
  @quantity_total
end

#quantity_usedObject

Returns the value of attribute quantity_used



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def quantity_used
  @quantity_used
end

#statusObject

Returns the value of attribute status



10
11
12
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 10

def status
  @status
end

Class Method Details

.create(props) ⇒ Promocode

Factory method to create an event Promocode object from a hash

Parameters:

  • props (Hash)
    • properties to create object from

Returns:



16
17
18
19
20
21
22
# File 'lib/constantcontact/components/event_spot/promocode.rb', line 16

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