Class: YQuotes::Client
- Inherits:
-
Object
- Object
- YQuotes::Client
- Defined in:
- lib/yquotes.rb
Instance Method Summary collapse
-
#get_quote(ticker, args = {}) ⇒ Object
(also: #historical_data, #historical_quote)
get_quote: returns Daru::DataFrame of the quote with volume and close.
-
#initialize(filter_zero_volume = true) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Method Details
#get_quote(ticker, args = {}) ⇒ Object Also known as: historical_data, historical_quote
get_quote: returns Daru::DataFrame of the quote with volume and close
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/yquotes.rb', line 15 def get_quote(ticker, args = {}) if args.is_a? Hash start_date = args[:start_date] if args[:start_date] start_date ||= args[:s] if args[:s] end_date = args[:end_date] if args[:end_date] end_date ||= args[:e] if args[:e] period = args[:period] if args[:period] period ||= args[:p] if args[:p] end csv = @yahoo_client.get_csv(ticker, start_date, end_date, period) create_from_csv(csv) end |