Class: CalendarAssistant::AvailableBlock

Inherits:
Object
  • Object
show all
Includes:
HasDuration
Defined in:
lib/calendar_assistant/available_block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasDuration

#all_day?, cast_datetime, #contains?, #cover?, #current?, #duration, duration_in_seconds, #duration_in_seconds, #end_date, #end_time, #future?, #overlaps_end_of?, #overlaps_start_of?, #past?, #start_date, #start_time

Constructor Details

#initialize(**params) ⇒ AvailableBlock

Returns a new instance of AvailableBlock.



7
8
9
10
# File 'lib/calendar_assistant/available_block.rb', line 7

def initialize(**params)
  @start = HasDuration.cast_datetime(params[:start]) if params[:start]
  @end = HasDuration.cast_datetime(params[:end]) if params[:end]
end

Instance Attribute Details

#endObject (readonly)

Returns the value of attribute end.



5
6
7
# File 'lib/calendar_assistant/available_block.rb', line 5

def end
  @end
end

#startObject (readonly)

Returns the value of attribute start.



5
6
7
# File 'lib/calendar_assistant/available_block.rb', line 5

def start
  @start
end