Class: WeeklyplannerTemplate

Inherits:
PlannerTemplate
  • Object
show all
Defined in:
lib/weeklyplanner_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src, template: 'default') ⇒ WeeklyplannerTemplate



13
14
15
16
17
18
19
20
21
22
# File 'lib/weeklyplanner_template.rb', line 13

def initialize(src, template: 'default')
  
  super(src, template: template)
  @no = @xmldoc.root.text('summary/no')    
  template = 'landscape1' if template == 'default'
  
  lib = File.dirname(__FILE__)
  @template = File.join(lib, '..', 'template', template)
      
end

Instance Attribute Details

#noObject (readonly)

Returns the value of attribute no.



11
12
13
# File 'lib/weeklyplanner_template.rb', line 11

def no
  @no
end

Instance Method Details

#to_hObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/weeklyplanner_template.rb', line 24

def to_h()
  
  layout, style = fetch_css

  {
    'week' + @no + '_planner.html' => self.to_html, 
    'week_layout.css' => layout, 
    'week.css' => style
  }    
end