Class: Portera::Event::Builder
- Inherits:
-
Object
- Object
- Portera::Event::Builder
- Defined in:
- lib/portera/event.rb
Overview
Internal builder class for events
Instance Method Summary collapse
-
#duration(minutes) ⇒ Object
duration in minutes of the proposed event.
-
#initialize(event) ⇒ Builder
constructor
A new instance of Builder.
-
#range(dates) ⇒ Object
range of possible dates for the proposed event for a weekly event, use ‘week_of` instead of explicit date range.
-
#week_of(date) ⇒ Object
first date of week for the proposed event.
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 |