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

Returns a new instance of WeeklyplannerTemplate.



13
14
15
16
17
18
19
# 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'
      
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



21
22
23
24
25
26
27
28
29
30
# File 'lib/weeklyplanner_template.rb', line 21

def to_h()
  
  layout, style = fetch_css

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