Class: YQuotes::Client

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

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



11
12
13
# File 'lib/yquotes.rb', line 11

def initialize
  @yahoo_client = Yahoo.new
end

Instance Method Details

#get_quote(ticker, start_date = nil, end_date = nil, period = 'd') ⇒ Object Also known as: historical_data, historical_quote

get_quote: returns Daru::DataFrame of the quote with volume and close



16
17
18
19
# File 'lib/yquotes.rb', line 16

def get_quote(ticker, start_date=nil, end_date=nil, period='d')
  csv = @yahoo_client.get_csv(ticker, start_date, end_date, period)
  create_from_csv(csv)
end