Class: Flycal::SlotQuery
- Inherits:
-
Object
- Object
- Flycal::SlotQuery
- Defined in:
- lib/flycal/slot_query.rb
Overview
Resolves slots search params (template, window, duration) without calling Google.
Class Method Summary collapse
Class Method Details
.resolve(params = {}) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/flycal/slot_query.rb', line 10 def resolve(params = {}) p = params.respond_to?(:with_indifferent_access) ? params.with_indifferent_access : params calendar_ids = Array(p[:calendar_ids]).map(&:to_s).reject(&:empty?) raise Error, "calendar_ids are required" if calendar_ids.empty? timezone = TimeFormat.resolve(explicit: p[:timezone]) TimeFormat.with_zone(timezone) { build(p, calendar_ids, timezone) } end |