Module: Finnhub::Calendar
- Included in:
- Client
- Defined in:
- lib/Calendar.rb
Instance Method Summary collapse
- #earnings_calendar(from: nil, to: nil) ⇒ Object
- #economic_calendar ⇒ Object
- #ico_calendar ⇒ Object
- #ipo_calendar ⇒ Object
Instance Method Details
#earnings_calendar(from: nil, to: nil) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/Calendar.rb', line 7 def earnings_calendar(from: nil, to: nil) url = "/calendar/earnings?" from = from.to_date.to_s if from.is_a?(Time) url += "&from=#{from}" unless from.nil? to = to.to_date.to_s if to.is_a?(Time) url += "&to=#{to}" unless to.nil? url[-1] = "" if url[-1] == "?" request(url) end |
#economic_calendar ⇒ Object
3 4 5 |
# File 'lib/Calendar.rb', line 3 def economic_calendar request("/calendar/economic") end |
#ico_calendar ⇒ Object
21 22 23 |
# File 'lib/Calendar.rb', line 21 def ico_calendar request("/calendar/ico") end |
#ipo_calendar ⇒ Object
17 18 19 |
# File 'lib/Calendar.rb', line 17 def ipo_calendar request("/calendar/ipo") end |