Class: SimpleInvoice::Subscription
- Inherits:
-
Object
- Object
- SimpleInvoice::Subscription
- Defined in:
- lib/simple_invoice/subscription.rb
Instance Attribute Summary collapse
-
#billing_period_type ⇒ Object
Returns the value of attribute billing_period_type.
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#due_days ⇒ Object
Returns the value of attribute due_days.
-
#invoice_template ⇒ Object
Returns the value of attribute invoice_template.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Instance Method Summary collapse
Instance Attribute Details
#billing_period_type ⇒ Object
Returns the value of attribute billing_period_type.
4 5 6 |
# File 'lib/simple_invoice/subscription.rb', line 4 def billing_period_type @billing_period_type end |
#cancelled ⇒ Object
Returns the value of attribute cancelled.
4 5 6 |
# File 'lib/simple_invoice/subscription.rb', line 4 def cancelled @cancelled end |
#contact ⇒ Object
Returns the value of attribute contact.
4 5 6 |
# File 'lib/simple_invoice/subscription.rb', line 4 def contact @contact end |
#due_days ⇒ Object
Returns the value of attribute due_days.
4 5 6 |
# File 'lib/simple_invoice/subscription.rb', line 4 def due_days @due_days end |
#invoice_template ⇒ Object
Returns the value of attribute invoice_template.
4 5 6 |
# File 'lib/simple_invoice/subscription.rb', line 4 def invoice_template @invoice_template end |
#start_date ⇒ Object
Returns the value of attribute start_date.
4 5 6 |
# File 'lib/simple_invoice/subscription.rb', line 4 def start_date @start_date end |
Instance Method Details
#billing_periods ⇒ Enumerator
15 16 17 18 19 20 21 22 23 |
# File 'lib/simple_invoice/subscription.rb', line 15 def billing_periods Enumerator.new do |y| period = BillingPeriod.new billing_period_type, start_date loop do y.yield period period = period.next_billing_period end end end |
#cancel! ⇒ Object
6 7 8 |
# File 'lib/simple_invoice/subscription.rb', line 6 def cancel! @cancelled = true end |
#cancelled? ⇒ Boolean
10 11 12 |
# File 'lib/simple_invoice/subscription.rb', line 10 def cancelled? !!@cancelled end |