Class: ChargeBee::Coupon

Inherits:
Model
  • Object
show all
Defined in:
lib/chargebee/models/coupon.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

construct, #initialize, #inspect, #load, #method_missing, #to_s, uri_path

Constructor Details

This class inherits a constructor from ChargeBee::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ChargeBee::Model

Instance Attribute Details

#addon_constraintObject

Returns the value of attribute addon_constraint.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def addon_constraint
  @addon_constraint
end

#addon_idsObject

Returns the value of attribute addon_ids.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def addon_ids
  @addon_ids
end

#apply_discount_onObject

Returns the value of attribute apply_discount_on.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def apply_discount_on
  @apply_discount_on
end

#apply_onObject

Returns the value of attribute apply_on.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def apply_on
  @apply_on
end

#archived_atObject

Returns the value of attribute archived_at.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def archived_at
  @archived_at
end

#created_atObject

Returns the value of attribute created_at.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def created_at
  @created_at
end

#discount_amountObject

Returns the value of attribute discount_amount.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_amount
  @discount_amount
end

#discount_percentageObject

Returns the value of attribute discount_percentage.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_percentage
  @discount_percentage
end

#discount_quantityObject

Returns the value of attribute discount_quantity.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_quantity
  @discount_quantity
end

#discount_typeObject

Returns the value of attribute discount_type.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_type
  @discount_type
end

#duration_monthObject

Returns the value of attribute duration_month.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def duration_month
  @duration_month
end

#duration_typeObject

Returns the value of attribute duration_type.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def duration_type
  @duration_type
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def id
  @id
end

#invoice_nameObject

Returns the value of attribute invoice_name.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def invoice_name
  @invoice_name
end

#max_redemptionsObject

Returns the value of attribute max_redemptions.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def max_redemptions
  @max_redemptions
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def name
  @name
end

#plan_constraintObject

Returns the value of attribute plan_constraint.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def plan_constraint
  @plan_constraint
end

#plan_idsObject

Returns the value of attribute plan_ids.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def plan_ids
  @plan_ids
end

#redemptionsObject

Returns the value of attribute redemptions.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def redemptions
  @redemptions
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def status
  @status
end

#valid_tillObject

Returns the value of attribute valid_till.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def valid_till
  @valid_till
end

Class Method Details

.create(params, env = nil) ⇒ Object

OPERATIONS




12
13
14
# File 'lib/chargebee/models/coupon.rb', line 12

def self.create(params, env=nil)
  Request.send('post', uri_path("coupons"), params, env)
end

.list(params = {}, env = nil) ⇒ Object



16
17
18
# File 'lib/chargebee/models/coupon.rb', line 16

def self.list(params={}, env=nil)
  Request.send('get', uri_path("coupons"), params, env)
end

.retrieve(id, env = nil) ⇒ Object



20
21
22
# File 'lib/chargebee/models/coupon.rb', line 20

def self.retrieve(id, env=nil)
  Request.send('get', uri_path("coupons",id.to_s), {}, env)
end