Class: Stripe::Plans::BillingTier

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/stripe/billing_tier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ BillingTier

Returns a new instance of BillingTier.



18
19
20
21
22
# File 'lib/stripe/billing_tier.rb', line 18

def initialize(attrs)
  @up_to = attrs[:up_to]
  @flat_amount = attrs[:flat_amount]
  @unit_amount = attrs[:unit_amount]
end

Instance Attribute Details

#flat_amountObject

Returns the value of attribute flat_amount.



16
17
18
# File 'lib/stripe/billing_tier.rb', line 16

def flat_amount
  @flat_amount
end

#unit_amountObject

Returns the value of attribute unit_amount.



16
17
18
# File 'lib/stripe/billing_tier.rb', line 16

def unit_amount
  @unit_amount
end

#up_toObject

Returns the value of attribute up_to.



16
17
18
# File 'lib/stripe/billing_tier.rb', line 16

def up_to
  @up_to
end

Instance Method Details

#to_hObject



24
25
26
27
28
29
30
# File 'lib/stripe/billing_tier.rb', line 24

def to_h
  {
    up_to: up_to,
    flat_amount: flat_amount,
    unit_amount: unit_amount
  }.compact
end