Class: Biz::Periods::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/biz/periods/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(schedule) ⇒ Proxy

Returns a new instance of Proxy.



7
8
9
# File 'lib/biz/periods/proxy.rb', line 7

def initialize(schedule)
  @schedule = schedule
end

Instance Method Details

#after(origin) ⇒ Object



11
12
13
# File 'lib/biz/periods/proxy.rb', line 11

def after(origin)
  After.new(schedule, origin)
end

#before(origin) ⇒ Object



15
16
17
# File 'lib/biz/periods/proxy.rb', line 15

def before(origin)
  Before.new(schedule, origin)
end

#on(date) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/biz/periods/proxy.rb', line 19

def on(date)
  schedule
    .periods
    .after(schedule.in_zone.on_date(date, DayTime.midnight))
    .timeline
    .until(schedule.in_zone.on_date(date, DayTime.endnight))
end