Methods
- D
- N
Attributes
| [R] | amount_off | |
| [R] | currency | |
| [R] | duration | |
| [R] | duration_in_months | |
| [R] | id | |
| [R] | percent_off |
Class Public methods
new(data) Link
Source: show
# File app/models/billing/coupon.rb, line 8 def initialize(data) # FIXME: stop treating Stripe:: objects as hashes, just pass the objects if data.respond_to?(:keys) data = ActiveSupport::HashWithIndifferentAccess.new(data) end @amount_off = data[:amount_off] @currency = data[:currency] @duration = data[:duration] @duration_in_months = data[:duration_in_months] @id = data[:code] || data[:id] @percent_off = data[:percent_off] end