Class: OandaAPI::Resource::Account

Inherits:
OandaAPI::ResourceBase show all
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

Attributes inherited from OandaAPI::ResourceBase

#location

Instance Method Summary collapse

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_currencyObject 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
end

#account_idObject 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
end

#account_nameObject 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
end

#balanceObject

Returns the value of attribute balance.



7
8
9
# File 'lib/oanda_api/resource/account.rb', line 7

def balance
  @balance
end

#margin_availableObject

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_rateObject

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_usedObject

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_ordersObject

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_tradesObject

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_plObject

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_plObject

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

#passwordObject



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

#usernameObject



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