Class: Recurly::Account
Instance Attribute Summary
Attributes inherited from Resource
#attributes, #etag, #response, #uri
Class Method Summary collapse
-
.active ⇒ Pager<Account>
A pager that yields
active
accounts. -
.adjustments ⇒ Pager<Resource>, []
A pager that yields adjustments for persisted accounts; an empty array otherwise.
- .billing_info ⇒ BillingInfo?
-
.closed ⇒ Pager<Account>
A pager that yields
closed
accounts. -
.invoice! ⇒ Invoice
A newly-created invoice.
-
.invoices ⇒ Pager<Resource>, []
A pager that yields invoices for persisted accounts; an empty array otherwise.
-
.non_subscriber ⇒ Pager<Account>
A pager that yields
non_subscriber
accounts. -
.past_due ⇒ Pager<Account>
A pager that yields
past_due
accounts. - .redemption ⇒ Redemption?
-
.reopen ⇒ true, false
Reopen an account.
-
.subscriber ⇒ Pager<Account>
A pager that yields
subscriber
accounts. -
.subscriptions ⇒ Pager<Resource>, []
A pager that yields subscriptions for persisted accounts; an empty array otherwise.
-
.transactions ⇒ Pager<Resource>, []
A pager that yields transactions for persisted accounts; an empty array otherwise.
Methods inherited from Resource
#==, all, associations, belongs_to, #changed, #changed?, #changed_attributes, #changes, collection_name, count, create, create!, define_attribute_methods, #destroy, #destroyed?, embedded!, #errors, find, find_each, first, from_response, from_xml, has_many, has_one, #initialize, #inspect, #marshal_dump, #marshal_load, member_name, member_path, #new_record?, paginate, #persist!, #persisted?, #previous_changes, #read_attribute, reflect_on_association, #reload, resource_name, #save, #save!, scope, scopes, #signable_attributes, #to_param, #to_xml, #update_attributes, #update_attributes!, #valid?, #write_attribute
Constructor Details
This class inherits a constructor from Recurly::Resource
Class Method Details
.active ⇒ Pager<Account>
Returns A pager that yields active
accounts.
6 |
# File 'lib/recurly/account.rb', line 6 scope :active, :state => :active |
.adjustments ⇒ Pager<Resource>, []
Returns A pager that yields adjustments for persisted accounts; an empty array otherwise.
15 |
# File 'lib/recurly/account.rb', line 15 has_many :adjustments |
.billing_info ⇒ BillingInfo?
21 |
# File 'lib/recurly/account.rb', line 21 has_one :billing_info, :readonly => false |
.closed ⇒ Pager<Account>
Returns A pager that yields closed
accounts.
7 |
# File 'lib/recurly/account.rb', line 7 scope :closed, :state => :closed |
.invoice! ⇒ Invoice
Returns A newly-created invoice.
42 43 44 45 46 |
# File 'lib/recurly/account.rb', line 42 def invoice! Invoice.from_response API.post(invoices.uri) rescue Recurly::API::UnprocessableEntity => e raise Invalid, e. end |
.invoices ⇒ Pager<Resource>, []
Returns A pager that yields invoices for persisted accounts; an empty array otherwise.
16 |
# File 'lib/recurly/account.rb', line 16 has_many :invoices |
.non_subscriber ⇒ Pager<Account>
Returns A pager that yields non_subscriber
accounts.
9 |
# File 'lib/recurly/account.rb', line 9 scope :non_subscriber, :state => :non_subscriber |
.past_due ⇒ Pager<Account>
Returns A pager that yields past_due
accounts.
10 |
# File 'lib/recurly/account.rb', line 10 scope :past_due, :state => :past_due |
.reopen ⇒ true, false
Reopen an account.
53 54 55 56 57 |
# File 'lib/recurly/account.rb', line 53 def reopen return false unless self[:reopen] reload self[:reopen].call true end |
.subscriber ⇒ Pager<Account>
Returns A pager that yields subscriber
accounts.
8 |
# File 'lib/recurly/account.rb', line 8 scope :subscriber, :state => :subscriber |