Class: IEX::Quote

Inherits:
Resource
  • Object
show all
Defined in:
lib/iex/quote.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get(symbol) ⇒ Object



48
49
50
51
52
# File 'lib/iex/quote.rb', line 48

def self.get(symbol)
  new IEX::Api::Quote.get(q: symbol)
rescue Faraday::ResourceNotFound => e
  raise IEX::Errors::SymbolNotFoundError.new(symbol, e.response[:body])
end

Instance Method Details

#change_percent_s ⇒ Object



40
41
42
43
44
45
46
# File 'lib/iex/quote.rb', line 40

def change_percent_s
  [
    change_percent > 0 ? '+' : '',
    format('%.2f', change_percent * 100),
    '%'
  ].join
end