Class: Carendar::CalendarItem
- Inherits:
-
Struct
- Object
- Struct
- Carendar::CalendarItem
- Defined in:
- lib/carendar.rb
Instance Attribute Summary collapse
-
#ends_at ⇒ Object
Returns the value of attribute ends_at.
-
#offset_left ⇒ Object
Returns the value of attribute offset_left.
-
#offset_right ⇒ Object
Returns the value of attribute offset_right.
-
#options ⇒ Object
Returns the value of attribute options.
-
#overlapping_with_earlier ⇒ Object
Returns the value of attribute overlapping_with_earlier.
-
#overlapping_with_later ⇒ Object
Returns the value of attribute overlapping_with_later.
-
#starts_at ⇒ Object
Returns the value of attribute starts_at.
Instance Method Summary collapse
Instance Attribute Details
#ends_at ⇒ Object
Returns the value of attribute ends_at
9 10 11 |
# File 'lib/carendar.rb', line 9 def ends_at @ends_at end |
#offset_left ⇒ Object
Returns the value of attribute offset_left.
10 11 12 |
# File 'lib/carendar.rb', line 10 def offset_left @offset_left end |
#offset_right ⇒ Object
Returns the value of attribute offset_right.
10 11 12 |
# File 'lib/carendar.rb', line 10 def offset_right @offset_right end |
#options ⇒ Object
Returns the value of attribute options
9 10 11 |
# File 'lib/carendar.rb', line 9 def end |
#overlapping_with_earlier ⇒ Object
Returns the value of attribute overlapping_with_earlier.
10 11 12 |
# File 'lib/carendar.rb', line 10 def overlapping_with_earlier @overlapping_with_earlier end |
#overlapping_with_later ⇒ Object
Returns the value of attribute overlapping_with_later.
10 11 12 |
# File 'lib/carendar.rb', line 10 def overlapping_with_later @overlapping_with_later end |
#starts_at ⇒ Object
Returns the value of attribute starts_at
9 10 11 |
# File 'lib/carendar.rb', line 9 def starts_at @starts_at end |
Instance Method Details
#color ⇒ Object
27 28 29 30 31 |
# File 'lib/carendar.rb', line 27 def color '#' + (0..2).map do VisitorsController.r.rand(255).to_i.to_s(16) end.join('') end |
#day ⇒ Object
11 12 13 |
# File 'lib/carendar.rb', line 11 def day starts_at.beginning_of_day end |
#duration ⇒ Object
15 16 17 |
# File 'lib/carendar.rb', line 15 def duration end_min - start_min end |
#end_min ⇒ Object
23 24 25 |
# File 'lib/carendar.rb', line 23 def end_min ends_at.hour * 60 + ends_at.minute end |
#start_min ⇒ Object
19 20 21 |
# File 'lib/carendar.rb', line 19 def start_min starts_at.hour * 60 + starts_at.minute end |