Class: Mo2tex::Pic::Slot

Inherits:
Base
  • Object
show all
Defined in:
lib/mo2tex/pic.rb

Constant Summary collapse

DAY_DURATION =

in hours

8

Instance Attribute Summary collapse

Attributes inherited from Base

#loc, #number

Instance Method Summary collapse

Methods inherited from Base

#location_tag

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

#slotObject (readonly)

Returns the value of attribute slot.



96
97
98
# File 'lib/mo2tex/pic.rb', line 96

def slot
  @slot
end

Instance Method Details

#colorObject



103
104
105
# File 'lib/mo2tex/pic.rb', line 103

def color
  return self.slot.color
end

#pic_durObject



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_timeObject



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_titleObject 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