Class: Mo2tex::Pic::Writer
- Inherits:
-
Object
- Object
- Mo2tex::Pic::Writer
- Includes:
- DateTimeHelper
- Defined in:
- lib/mo2tex/pic.rb
Constant Summary collapse
- DAYS_PER_PAGE =
12- DAYS_PER_ROW =
4- LOC_TAGS =
twelve tags in a repeating pattern
[ Location.new('PageFrame', 'nw'), ([[ Location.new('Container', 'ne') ] * 3, Location.new('Container', 'sw') ] * 3).flatten ].flatten
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#day_no ⇒ Object
Returns the value of attribute day_no.
-
#days ⇒ Object
Returns the value of attribute days.
-
#event_no ⇒ Object
Returns the value of attribute event_no.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#max_daily_hours ⇒ Object
readonly
Returns the value of attribute max_daily_hours.
-
#page_no ⇒ Object
Returns the value of attribute page_no.
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#school ⇒ Object
readonly
Returns the value of attribute school.
-
#total_hours_done ⇒ Object
readonly
Returns the value of attribute total_hours_done.
-
#trailer ⇒ Object
readonly
Returns the value of attribute trailer.
Instance Method Summary collapse
- #absolute_pic_objects_include_path ⇒ Object
- #generate ⇒ Object
-
#initialize(s) ⇒ Writer
constructor
A new instance of Writer.
Methods included from DateTimeHelper
Constructor Details
#initialize(s) ⇒ Writer
212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/mo2tex/pic.rb', line 212 def initialize(s) @total_hours_done = 0 @school = s @header = read_header @trailer = read_trailer @body = read_body @max_daily_hours = calculate_max_daily_hours @page_no = @day_no = @event_no = 0 self.days = [] generate_days self.pages = create_pages end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
209 210 211 |
# File 'lib/mo2tex/pic.rb', line 209 def body @body end |
#day_no ⇒ Object
Returns the value of attribute day_no.
210 211 212 |
# File 'lib/mo2tex/pic.rb', line 210 def day_no @day_no end |
#days ⇒ Object
Returns the value of attribute days.
210 211 212 |
# File 'lib/mo2tex/pic.rb', line 210 def days @days end |
#event_no ⇒ Object
Returns the value of attribute event_no.
210 211 212 |
# File 'lib/mo2tex/pic.rb', line 210 def event_no @event_no end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
209 210 211 |
# File 'lib/mo2tex/pic.rb', line 209 def header @header end |
#max_daily_hours ⇒ Object (readonly)
Returns the value of attribute max_daily_hours.
209 210 211 |
# File 'lib/mo2tex/pic.rb', line 209 def max_daily_hours @max_daily_hours end |
#page_no ⇒ Object
Returns the value of attribute page_no.
210 211 212 |
# File 'lib/mo2tex/pic.rb', line 210 def page_no @page_no end |
#pages ⇒ Object
Returns the value of attribute pages.
210 211 212 |
# File 'lib/mo2tex/pic.rb', line 210 def pages @pages end |
#school ⇒ Object (readonly)
Returns the value of attribute school.
209 210 211 |
# File 'lib/mo2tex/pic.rb', line 209 def school @school end |
#total_hours_done ⇒ Object (readonly)
Returns the value of attribute total_hours_done.
209 210 211 |
# File 'lib/mo2tex/pic.rb', line 209 def total_hours_done @total_hours_done end |
#trailer ⇒ Object (readonly)
Returns the value of attribute trailer.
209 210 211 |
# File 'lib/mo2tex/pic.rb', line 209 def trailer @trailer end |
Instance Method Details
#absolute_pic_objects_include_path ⇒ Object
236 237 238 |
# File 'lib/mo2tex/pic.rb', line 236 def absolute_pic_objects_include_path return File.(File.join(['..'] * 3, 'config', 'templates', 'pic', 'objects.pic'), __FILE__) end |
#generate ⇒ Object
225 226 227 228 229 230 231 232 233 234 |
# File 'lib/mo2tex/pic.rb', line 225 def generate result = '' self.pages.each do |page| result += self.header.result(binding) result += self.body.result(binding) result += self.trailer.result(binding) end return result end |