Class: RTicker::Entry
- Inherits:
-
Object
- Object
- RTicker::Entry
- Defined in:
- lib/rticker/entry.rb
Overview
Parent class to represent all types of ticker entries to watch. The classes that subclass from Entry are: Equity, Currency, Future, and Option.
Instance Attribute Summary collapse
-
#bold ⇒ Object
(also: #bold?)
Returns the value of attribute bold.
-
#curr_value ⇒ Object
Returns the value of attribute curr_value.
-
#description ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol.
-
#last_changed ⇒ Object
Returns the value of attribute last_changed.
-
#purchase_count ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol.
-
#purchase_price ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol.
-
#symbol ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol.
Instance Method Summary collapse
-
#initialize(symbol, description = nil, purchase_count = nil, purchase_price = nil, bold = false) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(symbol, description = nil, purchase_count = nil, purchase_price = nil, bold = false) ⇒ Entry
Returns a new instance of Entry.
26 27 28 29 30 31 32 33 |
# File 'lib/rticker/entry.rb', line 26 def initialize (symbol, description=nil, purchase_count=nil, purchase_price=nil, bold=false) @symbol = symbol @description = description @purchase_count = purchase_count @purchase_price = purchase_price @bold = bold @last_changed = nil end |
Instance Attribute Details
#bold ⇒ Object Also known as: bold?
Returns the value of attribute bold.
22 23 24 |
# File 'lib/rticker/entry.rb', line 22 def bold @bold end |
#curr_value ⇒ Object
Returns the value of attribute curr_value.
22 23 24 |
# File 'lib/rticker/entry.rb', line 22 def curr_value @curr_value end |
#description ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol. If a description is not provided, the symbol itself is displayed to the user. If the user provides information on having purchased an entry (for example AAPL stock), the user may specify how many via @purchase_count (in this case how many shares), and for how much via @purchase_price (in this case how much paid per share). A user can specify a negative this entry should stand apart from other entries when displayed to the user.
21 22 23 |
# File 'lib/rticker/entry.rb', line 21 def description @description end |
#last_changed ⇒ Object
Returns the value of attribute last_changed.
22 23 24 |
# File 'lib/rticker/entry.rb', line 22 def last_changed @last_changed end |
#purchase_count ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol. If a description is not provided, the symbol itself is displayed to the user. If the user provides information on having purchased an entry (for example AAPL stock), the user may specify how many via @purchase_count (in this case how many shares), and for how much via @purchase_price (in this case how much paid per share). A user can specify a negative this entry should stand apart from other entries when displayed to the user.
21 22 23 |
# File 'lib/rticker/entry.rb', line 21 def purchase_count @purchase_count end |
#purchase_price ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol. If a description is not provided, the symbol itself is displayed to the user. If the user provides information on having purchased an entry (for example AAPL stock), the user may specify how many via @purchase_count (in this case how many shares), and for how much via @purchase_price (in this case how much paid per share). A user can specify a negative this entry should stand apart from other entries when displayed to the user.
21 22 23 |
# File 'lib/rticker/entry.rb', line 21 def purchase_price @purchase_price end |
#symbol ⇒ Object
etc.) @description is an optional string that can give a more user-friendly description of a symbol. If a description is not provided, the symbol itself is displayed to the user. If the user provides information on having purchased an entry (for example AAPL stock), the user may specify how many via @purchase_count (in this case how many shares), and for how much via @purchase_price (in this case how much paid per share). A user can specify a negative this entry should stand apart from other entries when displayed to the user.
21 22 23 |
# File 'lib/rticker/entry.rb', line 21 def symbol @symbol end |