Module: IEX::Api::Price

Defined in:
lib/iex/api/price.rb

Class Method Summary collapse

Class Method Details

.connection(symbol) ⇒ Object


8
9
10
# File 'lib/iex/api/price.rb', line 8

def self.connection(symbol)
  IEX::Api.default_connection "#{symbol}/price"
end

.get(symbol) ⇒ Object


4
5
6
# File 'lib/iex/api/price.rb', line 4

def self.get(symbol)
  connection(symbol).get.body.to_f
end