Class: Teems::Commands::OooScheduleEntry
- Inherits:
-
Data
- Object
- Data
- Teems::Commands::OooScheduleEntry
- Defined in:
- lib/teems/commands/ooo.rb
Overview
A parsed –start or –end value. Produces ISO datetime strings for auto-reply schedules and calendar events. Kind is :timed, :date, or :unscheduled; value is a Time, Date, or nil respectively.
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #all_day? ⇒ Boolean
- #event_end_iso ⇒ Object
- #event_start_iso ⇒ Object
- #reply_end_iso ⇒ Object
- #reply_start_iso ⇒ Object
- #timed? ⇒ Boolean
- #unscheduled? ⇒ Boolean
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind
55 56 57 |
# File 'lib/teems/commands/ooo.rb', line 55 def kind @kind end |
#value ⇒ Object (readonly)
Returns the value of attribute value
55 56 57 |
# File 'lib/teems/commands/ooo.rb', line 55 def value @value end |
Instance Method Details
#all_day? ⇒ Boolean
57 |
# File 'lib/teems/commands/ooo.rb', line 57 def all_day? = kind == :date |
#event_end_iso ⇒ Object
73 74 75 76 77 78 |
# File 'lib/teems/commands/ooo.rb', line 73 def event_end_iso base = value || Date.today return base.strftime('%Y-%m-%dT%H:%M:%S') if timed? "#{base + 1}T00:00:00" end |
#event_start_iso ⇒ Object
68 69 70 71 |
# File 'lib/teems/commands/ooo.rb', line 68 def event_start_iso base = value || Date.today timed? ? base.strftime('%Y-%m-%dT%H:%M:%S') : "#{base}T00:00:00" end |
#reply_end_iso ⇒ Object
64 65 66 |
# File 'lib/teems/commands/ooo.rb', line 64 def reply_end_iso timed? ? value.strftime('%Y-%m-%dT%H:%M:%S') : "#{value}T23:59:59" end |
#reply_start_iso ⇒ Object
60 61 62 |
# File 'lib/teems/commands/ooo.rb', line 60 def reply_start_iso timed? ? value.strftime('%Y-%m-%dT%H:%M:%S') : "#{value}T00:00:00" end |
#timed? ⇒ Boolean
56 |
# File 'lib/teems/commands/ooo.rb', line 56 def timed? = kind == :timed |
#unscheduled? ⇒ Boolean
58 |
# File 'lib/teems/commands/ooo.rb', line 58 def unscheduled? = kind == :unscheduled |