Class: OandaAPI::Resource::Account
- Inherits:
-
OandaAPI::ResourceBase
- Object
- OandaAPI::ResourceBase
- OandaAPI::Resource::Account
- Defined in:
- lib/oanda_api/resource/account.rb
Overview
Account value object. See the Oanda Developer Guide for information about Accounts.
Constant Summary
Constants inherited from OandaAPI::ResourceBase
OandaAPI::ResourceBase::NOT_PLURALIZED
Instance Attribute Summary collapse
-
#account_currency ⇒ Object
(also: #currency)
Returns the value of attribute account_currency.
-
#account_id ⇒ Object
(also: #id)
Returns the value of attribute account_id.
-
#account_name ⇒ Object
(also: #name)
Returns the value of attribute account_name.
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#margin_available ⇒ Object
Returns the value of attribute margin_available.
-
#margin_rate ⇒ Object
Returns the value of attribute margin_rate.
-
#margin_used ⇒ Object
Returns the value of attribute margin_used.
-
#open_orders ⇒ Object
Returns the value of attribute open_orders.
-
#open_trades ⇒ Object
Returns the value of attribute open_trades.
-
#realized_pl ⇒ Object
Returns the value of attribute realized_pl.
-
#unrealized_pl ⇒ Object
Returns the value of attribute unrealized_pl.
Attributes inherited from OandaAPI::ResourceBase
Instance Method Summary collapse
-
#deprecated(method) ⇒ Object
:nocov:.
-
#initialize(attributes = {}) ⇒ Account
constructor
A new instance of Account.
- #password ⇒ Object
-
#password=(v) ⇒ Object
:nocov:.
- #username ⇒ Object
- #username=(v) ⇒ Object
Methods inherited from OandaAPI::ResourceBase
class_from_symbol, labs_resource?, pluralize, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ Account
Returns a new instance of Account.
28 29 30 31 32 |
# File 'lib/oanda_api/resource/account.rb', line 28 def initialize(attributes = {}) @open_orders = [] @open_trades = [] super end |
Instance Attribute Details
#account_currency ⇒ Object Also known as: currency
Returns the value of attribute account_currency.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def account_currency @account_currency end |
#account_id ⇒ Object Also known as: id
Returns the value of attribute account_id.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def account_id @account_id end |
#account_name ⇒ Object Also known as: name
Returns the value of attribute account_name.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def account_name @account_name end |
#balance ⇒ Object
Returns the value of attribute balance.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def balance @balance end |
#margin_available ⇒ Object
Returns the value of attribute margin_available.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def margin_available @margin_available end |
#margin_rate ⇒ Object
Returns the value of attribute margin_rate.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def margin_rate @margin_rate end |
#margin_used ⇒ Object
Returns the value of attribute margin_used.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def margin_used @margin_used end |
#open_orders ⇒ Object
Returns the value of attribute open_orders.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def open_orders @open_orders end |
#open_trades ⇒ Object
Returns the value of attribute open_trades.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def open_trades @open_trades end |
#realized_pl ⇒ Object
Returns the value of attribute realized_pl.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def realized_pl @realized_pl end |
#unrealized_pl ⇒ Object
Returns the value of attribute unrealized_pl.
7 8 9 |
# File 'lib/oanda_api/resource/account.rb', line 7 def unrealized_pl @unrealized_pl end |
Instance Method Details
#deprecated(method) ⇒ Object
:nocov:
51 52 53 |
# File 'lib/oanda_api/resource/account.rb', line 51 def deprecated(method) warn Kernel.caller.first + " [ DEPRECATED ] #{method} has been removed by Oanda" end |
#password ⇒ Object
39 40 41 |
# File 'lib/oanda_api/resource/account.rb', line 39 def password deprecated :password end |
#password=(v) ⇒ Object
:nocov:
35 36 37 |
# File 'lib/oanda_api/resource/account.rb', line 35 def password=(v) deprecated :password end |
#username ⇒ Object
47 48 49 |
# File 'lib/oanda_api/resource/account.rb', line 47 def username deprecated :username end |
#username=(v) ⇒ Object
43 44 45 |
# File 'lib/oanda_api/resource/account.rb', line 43 def username=(v) deprecated :username end |