Class: Recurly::BillingInfo

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

Instance Attribute Summary collapse

Attributes inherited from Resource

#attributes, #etag, #response, #uri

Instance 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, #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

Instance Attribute Details

#type"credit_card", ... (readonly)

Returns The type of billing info.

Returns:

  • ("credit_card", "paypal", nil)

    The type of billing info.



34
35
36
# File 'lib/recurly/billing_info.rb', line 34

def type
  @type
end

Instance Method Details

#accountAccount

Returns:



4
# File 'lib/recurly/billing_info.rb', line 4

belongs_to :account

#inspectString

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/recurly/billing_info.rb', line 37

def inspect
  attributes = self.class.attribute_names
  case type
  when 'credit_card'
    attributes -= %w(paypal_billing_agreement_id)
  when 'paypal'
    attributes -= %w(
      card_type year month start_year start_month issue_number
      first_six last_four
    )
  end
  super attributes
end