Class: Tradier::Account
- Inherits:
-
Base
- Object
- Base
- Tradier::Account
show all
- Defined in:
- lib/tradier/account.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
#[], #attr_equal, attr_reader, #attrs, #attrs_equal, from_response, #initialize, #update
Constructor Details
This class inherits a constructor from Tradier::Base
Instance Attribute Details
#account_number ⇒ Object
Returns the value of attribute account_number.
5
6
7
|
# File 'lib/tradier/account.rb', line 5
def account_number
@account_number
end
|
#classification ⇒ Object
Returns the value of attribute classification.
5
6
7
|
# File 'lib/tradier/account.rb', line 5
def classification
@classification
end
|
#type ⇒ Object
Returns the value of attribute type.
5
6
7
|
# File 'lib/tradier/account.rb', line 5
def type
@type
end
|
Instance Method Details
#cash? ⇒ Boolean
11
12
13
|
# File 'lib/tradier/account.rb', line 11
def cash?
type.downcase == 'cash'
end
|
#gainloss ⇒ Object
23
24
|
# File 'lib/tradier/account.rb', line 23
def gainloss
end
|
#history ⇒ Object
26
27
|
# File 'lib/tradier/account.rb', line 26
def history
end
|
#individual_account? ⇒ Boolean
29
30
31
|
# File 'lib/tradier/account.rb', line 29
def individual_account?
classification.downcase == 'individual'
end
|
#ira? ⇒ Boolean
49
50
51
|
# File 'lib/tradier/account.rb', line 49
def ira?
traditional_ira? || roth_ira? || rollover_ira?
end
|
#joint_account? ⇒ Boolean
33
34
35
|
# File 'lib/tradier/account.rb', line 33
def joint_account?
classification.downcase == 'joint'
end
|
#margin? ⇒ Boolean
7
8
9
|
# File 'lib/tradier/account.rb', line 7
def margin?
type.downcase == 'margin'
end
|
#orders ⇒ Object
19
20
21
|
# File 'lib/tradier/account.rb', line 19
def orders
@attrs[:orders][:order].map { |a| Tradier::Order.new(a) }
end
|
#positions ⇒ Object
15
16
17
|
# File 'lib/tradier/account.rb', line 15
def positions
@attrs[:positions][:position].map { |a| Tradier::Position.new(a) }
end
|
#rollover_ira? ⇒ Boolean
45
46
47
|
# File 'lib/tradier/account.rb', line 45
def rollover_ira?
classification.downcase == 'rollover_ira'
end
|
#roth_ira? ⇒ Boolean
41
42
43
|
# File 'lib/tradier/account.rb', line 41
def roth_ira?
classification.downcase == 'roth_ira'
end
|
#traditional_ira? ⇒ Boolean
37
38
39
|
# File 'lib/tradier/account.rb', line 37
def traditional_ira?
classification.downcase == 'traditional_ira'
end
|