Class: HookBridge::Subscription
- Inherits:
-
Object
- Object
- HookBridge::Subscription
- Defined in:
- lib/hookbridge/types.rb
Instance Attribute Summary collapse
-
#cancel_at_period_end ⇒ Object
readonly
Returns the value of attribute cancel_at_period_end.
-
#current_period_end ⇒ Object
readonly
Returns the value of attribute current_period_end.
-
#limits ⇒ Object
readonly
Returns the value of attribute limits.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
-
#initialize(data) ⇒ Subscription
constructor
A new instance of Subscription.
Constructor Details
#initialize(data) ⇒ Subscription
Returns a new instance of Subscription.
313 314 315 316 317 318 319 320 |
# File 'lib/hookbridge/types.rb', line 313 def initialize(data) @plan = data["plan"] @status = data["status"] @limits = SubscriptionLimits.new(data["limits"] || {}) @usage = SubscriptionUsage.new(data["usage"] || {}) @cancel_at_period_end = data["cancel_at_period_end"] @current_period_end = data["current_period_end"] ? Time.parse(data["current_period_end"]) : nil end |
Instance Attribute Details
#cancel_at_period_end ⇒ Object (readonly)
Returns the value of attribute cancel_at_period_end.
311 312 313 |
# File 'lib/hookbridge/types.rb', line 311 def cancel_at_period_end @cancel_at_period_end end |
#current_period_end ⇒ Object (readonly)
Returns the value of attribute current_period_end.
311 312 313 |
# File 'lib/hookbridge/types.rb', line 311 def current_period_end @current_period_end end |
#limits ⇒ Object (readonly)
Returns the value of attribute limits.
311 312 313 |
# File 'lib/hookbridge/types.rb', line 311 def limits @limits end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
311 312 313 |
# File 'lib/hookbridge/types.rb', line 311 def plan @plan end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
311 312 313 |
# File 'lib/hookbridge/types.rb', line 311 def status @status end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
311 312 313 |
# File 'lib/hookbridge/types.rb', line 311 def usage @usage end |