Class: BC::QuoteDetail

Inherits:
Object
  • Object
show all
Defined in:
lib/bloomberg_currency/quote_detail.rb

Overview

Represents a currency quote detail

Instance Attribute Summary collapse

Instance Method Summary collapse

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_rangeObject (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_rangeObject (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

#highObject (readonly)

Returns the value of attribute high.



41
42
43
# File 'lib/bloomberg_currency/quote_detail.rb', line 41

def high
  @high
end

#lowObject (readonly)

Returns the value of attribute low.



41
42
43
# File 'lib/bloomberg_currency/quote_detail.rb', line 41

def low
  @low
end

#openObject (readonly)

Returns the value of attribute open.



41
42
43
# File 'lib/bloomberg_currency/quote_detail.rb', line 41

def open
  @open
end

#previous_closeObject (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_ytdObject (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