Class: IronBank::Resources::Invoice
- Inherits:
-
IronBank::Resource
- Object
- IronBank::Resource
- IronBank::Resources::Invoice
- Defined in:
- lib/iron_bank/resources/invoice.rb
Overview
A Zuora invoice is generated through a bill run, belongs to an account and holds many invoice items.
Instance Attribute Summary
Attributes inherited from IronBank::Resource
Class Method Summary collapse
-
.excluded_fields ⇒ Object
See the comment for the instance method ‘#body`.
- .single_resource_query_fields ⇒ Object
Instance Method Summary collapse
-
#body ⇒ Object
We can only retrieve one invoice body at a time, hence Body is excluded from the query fields, but is populated using the ‘find` class method.
Methods inherited from IronBank::Resource
#==, #id, #initialize, #inspect, object_name, #reload, #remove_instance_vars, with_cache, with_local_records
Methods included from Associations::ClassMethods
Methods included from Metadata
#excluded_fields, #fields, #query_custom_fields, #query_fields, #reset, #schema, #single_resource_query_fields, #with_schema
Methods included from Queryable
#all, #find, #find_each, #first, #where
Methods included from Associations
Constructor Details
This class inherits a constructor from IronBank::Resource
Class Method Details
.excluded_fields ⇒ Object
See the comment for the instance method ‘#body`
10 11 12 |
# File 'lib/iron_bank/resources/invoice.rb', line 10 def self.excluded_fields super + single_resource_query_fields end |
.single_resource_query_fields ⇒ Object
14 15 16 |
# File 'lib/iron_bank/resources/invoice.rb', line 14 def self.single_resource_query_fields %w[Body] end |
Instance Method Details
#body ⇒ Object
We can only retrieve one invoice body at a time, hence Body is excluded from the query fields, but is populated using the ‘find` class method
29 30 31 |
# File 'lib/iron_bank/resources/invoice.rb', line 29 def body remote[:body] || reload.remote[:body] end |