Class: IGMarkets::Account
Overview
Contains details on an IG Markets account. Returned by DealingPlatform::AccountMethods#all.
Defined Under Namespace
Classes: Balance
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#account_alias ⇒ Object
The account_alias attribute.
-
#account_id ⇒ Object
The account_id attribute.
-
#account_name ⇒ Object
The account_name attribute.
-
#account_type ⇒ Symbol
The account_type attribute.
-
#balance ⇒ Balance
The balance attribute.
-
#can_transfer_from ⇒ Boolean
The can_transfer_from attribute.
-
#can_transfer_to ⇒ Boolean
The can_transfer_to attribute.
-
#currency ⇒ String
The currency attribute.
-
#preferred ⇒ Boolean
The preferred attribute.
-
#reload ⇒ Object
Reloads this account’s attributes by re-querying the IG Markets API.
-
#status ⇒ Symbol
The status attribute.
Methods inherited from Model
#==, allowed_values, attribute, attribute_type, attribute_value_allowed?, defined_attribute_names, deprecated_attribute, #initialize, #initialize_copy, #inspect, #to_h, valid_attribute?
Constructor Details
This class inherits a constructor from IGMarkets::Model
Instance Method Details
#account_alias ⇒ Object
The account_alias attribute.
12 |
# File 'lib/ig_markets/account.rb', line 12 attribute :account_alias |
#account_id ⇒ Object
The account_id attribute.
13 |
# File 'lib/ig_markets/account.rb', line 13 attribute :account_id |
#account_name ⇒ Object
The account_name attribute.
14 |
# File 'lib/ig_markets/account.rb', line 14 attribute :account_name |
#account_type ⇒ Symbol
The account_type attribute.
15 |
# File 'lib/ig_markets/account.rb', line 15 attribute :account_type, Symbol, allowed_values: %i[cfd physical spreadbet] |
#balance ⇒ Balance
The balance attribute.
16 |
# File 'lib/ig_markets/account.rb', line 16 attribute :balance, Balance |
#can_transfer_from ⇒ Boolean
The can_transfer_from attribute.
17 |
# File 'lib/ig_markets/account.rb', line 17 attribute :can_transfer_from, Boolean |
#can_transfer_to ⇒ Boolean
The can_transfer_to attribute.
18 |
# File 'lib/ig_markets/account.rb', line 18 attribute :can_transfer_to, Boolean |
#currency ⇒ String
The currency attribute.
19 |
# File 'lib/ig_markets/account.rb', line 19 attribute :currency, String, regex: Regex::CURRENCY |
#preferred ⇒ Boolean
The preferred attribute.
20 |
# File 'lib/ig_markets/account.rb', line 20 attribute :preferred, Boolean |
#reload ⇒ Object
Reloads this account’s attributes by re-querying the IG Markets API.
24 25 26 |
# File 'lib/ig_markets/account.rb', line 24 def reload self.attributes = @dealing_platform.account.all.detect { |a| a.account_id == account_id }.attributes end |
#status ⇒ Symbol
The status attribute.
21 |
# File 'lib/ig_markets/account.rb', line 21 attribute :status, Symbol, allowed_values: %i[disabled enabled suspended_from_dealing] |