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
Returns a new instance of Writer.
201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/mo2tex/pic.rb', line 201 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.
198 199 200 |
# File 'lib/mo2tex/pic.rb', line 198 def body @body end |
#day_no ⇒ Object
Returns the value of attribute day_no.
199 200 201 |
# File 'lib/mo2tex/pic.rb', line 199 def day_no @day_no end |
#days ⇒ Object
Returns the value of attribute days.
199 200 201 |
# File 'lib/mo2tex/pic.rb', line 199 def days @days end |
#event_no ⇒ Object
Returns the value of attribute event_no.
199 200 201 |
# File 'lib/mo2tex/pic.rb', line 199 def event_no @event_no end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
198 199 200 |
# File 'lib/mo2tex/pic.rb', line 198 def header @header end |
#max_daily_hours ⇒ Object (readonly)
Returns the value of attribute max_daily_hours.
198 199 200 |
# File 'lib/mo2tex/pic.rb', line 198 def max_daily_hours @max_daily_hours end |
#page_no ⇒ Object
Returns the value of attribute page_no.
199 200 201 |
# File 'lib/mo2tex/pic.rb', line 199 def page_no @page_no end |
#pages ⇒ Object
Returns the value of attribute pages.
199 200 201 |
# File 'lib/mo2tex/pic.rb', line 199 def pages @pages end |
#school ⇒ Object (readonly)
Returns the value of attribute school.
198 199 200 |
# File 'lib/mo2tex/pic.rb', line 198 def school @school end |
#total_hours_done ⇒ Object (readonly)
Returns the value of attribute total_hours_done.
198 199 200 |
# File 'lib/mo2tex/pic.rb', line 198 def total_hours_done @total_hours_done end |
#trailer ⇒ Object (readonly)
Returns the value of attribute trailer.
198 199 200 |
# File 'lib/mo2tex/pic.rb', line 198 def trailer @trailer end |
Instance Method Details
#absolute_pic_objects_include_path ⇒ Object
225 226 227 |
# File 'lib/mo2tex/pic.rb', line 225 def absolute_pic_objects_include_path return File.(File.join(['..'] * 3, 'config', 'templates', 'pic', 'objects.pic'), __FILE__) end |
#generate ⇒ Object
214 215 216 217 218 219 220 221 222 223 |
# File 'lib/mo2tex/pic.rb', line 214 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 |