Class: CalendarAssistant::AvailableBlock
- Inherits:
-
Object
- Object
- CalendarAssistant::AvailableBlock
- Includes:
- HasDuration
- Defined in:
- lib/calendar_assistant/available_block.rb
Instance Attribute Summary collapse
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(**params) ⇒ AvailableBlock
constructor
A new instance of AvailableBlock.
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
#end ⇒ Object (readonly)
Returns the value of attribute end.
5 6 7 |
# File 'lib/calendar_assistant/available_block.rb', line 5 def end @end end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
5 6 7 |
# File 'lib/calendar_assistant/available_block.rb', line 5 def start @start end |