Class: IEX::Resources::KeyStats

Inherits:
IEX::Resource show all
Defined in:
lib/iex/resources/key_stats.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ KeyStats

Returns a new instance of KeyStats.



74
75
76
77
78
# File 'lib/iex/resources/key_stats.rb', line 74

def initialize(data = {})
  super
  # TODO: require Hashie >= 2.5.8, see https://github.com/intridea/hashie/pull/457
  self['revenue_dollar'] = Base.to_dollar(amount: revenue)
end

Class Method Details

.get(symbol) ⇒ Object



80
81
82
83
84
# File 'lib/iex/resources/key_stats.rb', line 80

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