Class: Mo2tex::Pic::Slot
Constant Summary collapse
- DAY_DURATION =
in hours
8
Instance Attribute Summary collapse
-
#slot ⇒ Object
readonly
Returns the value of attribute slot.
Attributes inherited from Base
Instance Method Summary collapse
- #color ⇒ Object
-
#initialize(n, sl, lt) ⇒ Slot
constructor
A new instance of Slot.
- #pic_dur ⇒ Object
- #pic_time ⇒ Object
- #pic_title ⇒ Object (also: #title)
Methods inherited from Base
Constructor Details
#initialize(n, sl, lt) ⇒ Slot
Returns a new instance of Slot.
98 99 100 101 |
# File 'lib/mo2tex/pic.rb', line 98 def initialize(n, sl, lt) super(n, lt) @slot = sl end |
Instance Attribute Details
#slot ⇒ Object (readonly)
Returns the value of attribute slot.
96 97 98 |
# File 'lib/mo2tex/pic.rb', line 96 def slot @slot end |
Instance Method Details
#color ⇒ Object
103 104 105 |
# File 'lib/mo2tex/pic.rb', line 103 def color return self.slot.color end |
#pic_dur ⇒ Object
109 110 111 112 |
# File 'lib/mo2tex/pic.rb', line 109 def pic_dur result = (self.slot.dtend - self.slot.dtstart).to_f*24 return result end |
#pic_time ⇒ Object
114 115 116 |
# File 'lib/mo2tex/pic.rb', line 114 def pic_time return sprintf("%s-%s", self.slot.dtstart.hm_to_s, self.slot.dtend.hm_to_s) end |
#pic_title ⇒ Object Also known as: title
118 119 120 121 |
# File 'lib/mo2tex/pic.rb', line 118 def pic_title result = self.slot.class == Event ? make_pic_title : self.slot.title return result end |