Class: Portera::Event::Builder

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

Overview

Internal builder class for events

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ Builder

Returns a new instance of Builder.



55
56
57
# File 'lib/portera/event.rb', line 55

def initialize(event)
  @event = event
end

Instance Method Details

#duration(minutes) ⇒ Object

duration in minutes of the proposed event



60
61
62
# File 'lib/portera/event.rb', line 60

def duration(minutes)
  @event.duration = minutes
end

#range(dates) ⇒ Object

range of possible dates for the proposed event for a weekly event, use ‘week_of` instead of explicit date range



66
67
68
# File 'lib/portera/event.rb', line 66

def range(dates)
  @event.range = dates
end

#week_of(date) ⇒ Object

first date of week for the proposed event



71
72
73
# File 'lib/portera/event.rb', line 71

def week_of(date)
  range date...(date+7)
end