Class: Flashboy::Quote
- Inherits:
-
Object
- Object
- Flashboy::Quote
- Defined in:
- lib/flashboy/quote.rb
Instance Attribute Summary collapse
-
#ask ⇒ Object
readonly
Returns the value of attribute ask.
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
-
#pair ⇒ Object
readonly
Returns the value of attribute pair.
-
#volume ⇒ Object
readonly
Returns the value of attribute volume.
Instance Method Summary collapse
-
#initialize(data) ⇒ Quote
constructor
A new instance of Quote.
Constructor Details
#initialize(data) ⇒ Quote
Returns a new instance of Quote.
5 6 7 8 9 10 11 12 |
# File 'lib/flashboy/quote.rb', line 5 def initialize(data) @exchange = data[:exchange].to_s @pair = data[:pair].to_s @bid = data[:bid].to_s.to_f @ask = data[:ask].to_s.to_f @last = data[:last].to_s.to_f @volume = data[:volume].to_s.to_f end |
Instance Attribute Details
#ask ⇒ Object (readonly)
Returns the value of attribute ask.
3 4 5 |
# File 'lib/flashboy/quote.rb', line 3 def ask @ask end |
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
3 4 5 |
# File 'lib/flashboy/quote.rb', line 3 def bid @bid end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
3 4 5 |
# File 'lib/flashboy/quote.rb', line 3 def exchange @exchange end |
#last ⇒ Object (readonly)
Returns the value of attribute last.
3 4 5 |
# File 'lib/flashboy/quote.rb', line 3 def last @last end |
#pair ⇒ Object (readonly)
Returns the value of attribute pair.
3 4 5 |
# File 'lib/flashboy/quote.rb', line 3 def pair @pair end |
#volume ⇒ Object (readonly)
Returns the value of attribute volume.
3 4 5 |
# File 'lib/flashboy/quote.rb', line 3 def volume @volume end |