Class: SoapyBing::Accounts
- Inherits:
-
Object
- Object
- SoapyBing::Accounts
- Defined in:
- lib/soapy_bing/accounts.rb
Instance Attribute Summary collapse
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#oauth_credentials ⇒ Object
readonly
Returns the value of attribute oauth_credentials.
Instance Method Summary collapse
-
#initialize(oauth: {}, customer: {}) ⇒ Accounts
constructor
A new instance of Accounts.
- #list ⇒ Object
Constructor Details
#initialize(oauth: {}, customer: {}) ⇒ Accounts
Returns a new instance of Accounts.
6 7 8 9 |
# File 'lib/soapy_bing/accounts.rb', line 6 def initialize(oauth: {}, customer: {}) @oauth_credentials = OauthCredentials.new(oauth) @customer = Customer.new(customer) end |
Instance Attribute Details
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
4 5 6 |
# File 'lib/soapy_bing/accounts.rb', line 4 def customer @customer end |
#oauth_credentials ⇒ Object (readonly)
Returns the value of attribute oauth_credentials.
4 5 6 |
# File 'lib/soapy_bing/accounts.rb', line 4 def oauth_credentials @oauth_credentials end |
Instance Method Details
#list ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/soapy_bing/accounts.rb', line 11 def list do_request(Soap::Request::GetAccountsInfoRequest).map do |account| Account.new( developer_token: customer.developer_token, customer_id: customer.customer_id, account_id: account['Id'] ) end end |