Class: Recurly::Adjustment

Inherits:
Resource show all
Defined in:
lib/recurly/adjustment.rb

Class Attribute Summary collapse

Attributes inherited from Resource

#attributes, #etag, #response, #uri

Class Method Summary collapse

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, #to_param, #to_xml, #update_attributes, #update_attributes!, #valid?, #write_attribute

Constructor Details

This class inherits a constructor from Recurly::Resource

Class Attribute Details

.type"charge", ... (readonly)

Returns The type of adjustment.

Returns:

  • ("charge", "credit", nil)

    The type of adjustment.



37
38
39
# File 'lib/recurly/adjustment.rb', line 37

def type
  @type
end

Class Method Details

.accountAccount?

Returns:



13
# File 'lib/recurly/adjustment.rb', line 13

belongs_to :account

.chargesPager<Adjustment>

Returns a pager that yields charges.

Returns:



6
# File 'lib/recurly/adjustment.rb', line 6

scope :charges,  :type  => 'charge'

.creditsPager<Adjustment>

Returns a pager that yields credits.

Returns:



7
# File 'lib/recurly/adjustment.rb', line 7

scope :credits,  :type  => 'credit'

.initialize(attributes = {}) ⇒ Adjustment

Adjustments should be built through Recurly::Account instances.

Examples:

.adjustments.new attributes

Returns:

See Also:



45
46
47
# File 'lib/recurly/adjustment.rb', line 45

def initialize attributes = {}
  super({ :currency => Recurly.default_currency }.merge attributes)
end

.invoiceInvoice?

Returns:



15
# File 'lib/recurly/adjustment.rb', line 15

belongs_to :invoice

.invoicedPager<Adjustment>

Returns a pager that yields invoiced.

Returns:



10
# File 'lib/recurly/adjustment.rb', line 10

scope :invoiced, :state => 'invoiced'

.pendingPager<Adjustment>

Returns a pager that yields pending.

Returns:



9
# File 'lib/recurly/adjustment.rb', line 9

scope :pending,  :state => 'pending'