Class: BC::QuoteDetail
- Inherits:
-
Object
- Object
- BC::QuoteDetail
- Defined in:
- lib/bloomberg_currency/quote_detail.rb
Overview
Represents a currency quote detail
Instance Attribute Summary collapse
-
#day_range ⇒ Object
readonly
Returns the value of attribute day_range.
-
#fifty_two_week_range ⇒ Object
readonly
Returns the value of attribute fifty_two_week_range.
-
#high ⇒ Object
readonly
Returns the value of attribute high.
-
#low ⇒ Object
readonly
Returns the value of attribute low.
-
#open ⇒ Object
readonly
Returns the value of attribute open.
-
#previous_close ⇒ Object
readonly
Returns the value of attribute previous_close.
-
#total_return_ytd ⇒ Object
readonly
Returns the value of attribute total_return_ytd.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ QuoteDetail
constructor
A new instance of QuoteDetail.
Constructor Details
#initialize(attributes = {}) ⇒ QuoteDetail
Returns a new instance of QuoteDetail.
43 44 45 46 47 48 49 50 51 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 43 def initialize(attributes = {}) @previous_close = BC::API::Parser.parse_price(attributes[:prev_close]) @low = attributes[:low] @high = attributes[:high] @open = BC::API::Parser.parse_price(attributes[:open]) @day_range = BC::API::Parser.parse_price_range(attributes[:day_range]) @fifty_two_week_range = BC::API::Parser.parse_price_range(attributes[:fifty_two_week_range]) @total_return_ytd = BC::API::Parser.parse_tr_ytd(attributes[:total_return_ytd]) end |
Instance Attribute Details
#day_range ⇒ Object (readonly)
Returns the value of attribute day_range.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def day_range @day_range end |
#fifty_two_week_range ⇒ Object (readonly)
Returns the value of attribute fifty_two_week_range.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def fifty_two_week_range @fifty_two_week_range end |
#high ⇒ Object (readonly)
Returns the value of attribute high.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def high @high end |
#low ⇒ Object (readonly)
Returns the value of attribute low.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def low @low end |
#open ⇒ Object (readonly)
Returns the value of attribute open.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def open @open end |
#previous_close ⇒ Object (readonly)
Returns the value of attribute previous_close.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def previous_close @previous_close end |
#total_return_ytd ⇒ Object (readonly)
Returns the value of attribute total_return_ytd.
41 42 43 |
# File 'lib/bloomberg_currency/quote_detail.rb', line 41 def total_return_ytd @total_return_ytd end |