Class: GMoney::Position
- Inherits:
-
Object
- Object
- GMoney::Position
- Defined in:
- lib/gmoney/position.rb
Defined Under Namespace
Classes: PositionDeleteError, PositionRequestError
Instance Attribute Summary collapse
-
#cost_basis ⇒ Object
readonly
Returns the value of attribute cost_basis.
-
#days_gain ⇒ Object
readonly
Returns the value of attribute days_gain.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#feed_link ⇒ Object
readonly
Returns the value of attribute feed_link.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#gain ⇒ Object
readonly
Returns the value of attribute gain.
-
#gain_percentage ⇒ Object
readonly
Returns the value of attribute gain_percentage.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#market_value ⇒ Object
readonly
Returns the value of attribute market_value.
-
#return1w ⇒ Object
readonly
Returns the value of attribute return1w.
-
#return1y ⇒ Object
readonly
Returns the value of attribute return1y.
-
#return3m ⇒ Object
readonly
Returns the value of attribute return3m.
-
#return3y ⇒ Object
readonly
Returns the value of attribute return3y.
-
#return4w ⇒ Object
readonly
Returns the value of attribute return4w.
-
#return5y ⇒ Object
readonly
Returns the value of attribute return5y.
-
#return_overall ⇒ Object
readonly
Returns the value of attribute return_overall.
-
#return_ytd ⇒ Object
readonly
Returns the value of attribute return_ytd.
-
#shares ⇒ Object
readonly
Returns the value of attribute shares.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cost_basis ⇒ Object (readonly)
Returns the value of attribute cost_basis.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def cost_basis @cost_basis end |
#days_gain ⇒ Object (readonly)
Returns the value of attribute days_gain.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def days_gain @days_gain end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def exchange @exchange end |
#feed_link ⇒ Object (readonly)
Returns the value of attribute feed_link.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def feed_link @feed_link end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def full_name @full_name end |
#gain ⇒ Object (readonly)
Returns the value of attribute gain.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def gain @gain end |
#gain_percentage ⇒ Object (readonly)
Returns the value of attribute gain_percentage.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def gain_percentage @gain_percentage end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def id @id end |
#market_value ⇒ Object (readonly)
Returns the value of attribute market_value.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def market_value @market_value end |
#return1w ⇒ Object (readonly)
Returns the value of attribute return1w.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return1w @return1w end |
#return1y ⇒ Object (readonly)
Returns the value of attribute return1y.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return1y @return1y end |
#return3m ⇒ Object (readonly)
Returns the value of attribute return3m.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return3m @return3m end |
#return3y ⇒ Object (readonly)
Returns the value of attribute return3y.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return3y @return3y end |
#return4w ⇒ Object (readonly)
Returns the value of attribute return4w.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return4w @return4w end |
#return5y ⇒ Object (readonly)
Returns the value of attribute return5y.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return5y @return5y end |
#return_overall ⇒ Object (readonly)
Returns the value of attribute return_overall.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return_overall @return_overall end |
#return_ytd ⇒ Object (readonly)
Returns the value of attribute return_ytd.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def return_ytd @return_ytd end |
#shares ⇒ Object (readonly)
Returns the value of attribute shares.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def shares @shares end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def symbol @symbol end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def title @title end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
6 7 8 |
# File 'lib/gmoney/position.rb', line 6 def updated @updated end |
Class Method Details
.delete(id) ⇒ Object
25 26 27 |
# File 'lib/gmoney/position.rb', line 25 def self.delete(id) delete_position(id) end |
.find(id, options = {}) ⇒ Object
11 12 13 |
# File 'lib/gmoney/position.rb', line 11 def self.find(id, ={}) find_by_url("#{GF_PORTFOLIO_FEED_URL}/#{id.portfolio_id}/positions/#{id.position_id}", ) end |
Instance Method Details
#delete ⇒ Object
29 30 31 32 |
# File 'lib/gmoney/position.rb', line 29 def delete Position.delete(@id.position_feed_id) freeze end |
#transactions(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/gmoney/position.rb', line 15 def transactions(={}) if [:refresh] @transactions = Transaction.find(@id.position_feed_id, ) else @transactions ||= Transaction.find(@id.position_feed_id, ) end @transactions.is_a?(Array) ? @transactions : [@transactions] end |