Class: FidorApi::Account

Inherits:
Resource show all
Extended by:
AmountAttributes, ModelAttribute
Defined in:
lib/fidor_api/account.rb

Defined Under Namespace

Modules: ClientSupport

Instance Attribute Summary

Attributes inherited from Resource

#client

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AmountAttributes

amount_attribute, attributes, extended

Methods inherited from Resource

#initialize, model_name, #persisted?, request

Constructor Details

This class inherits a constructor from FidorApi::Resource

Class Method Details

.all(access_token, options = {}) ⇒ Object



25
26
27
# File 'lib/fidor_api/account.rb', line 25

def self.all(access_token, options = {})
  Collection.build(self, request(access_token: access_token, endpoint: "/accounts", query_params: options).body)
end

.first(access_token) ⇒ Object



29
30
31
# File 'lib/fidor_api/account.rb', line 29

def self.first(access_token)
  all(access_token, page: 1, per_page: 1).first
end

Instance Method Details

#customers=(array) ⇒ Object



33
34
35
# File 'lib/fidor_api/account.rb', line 33

def customers=(array)
  @customers = array.map { |customer| Customer.new(customer) }
end