Class: RhetButler::Web::PresentationApp

Inherits:
Object
  • Object
show all
Defined in:
lib/rhet-butler/web/presentation-app.rb

Direct Known Subclasses

MemoizedPresentationApp

Instance Method Summary collapse

Constructor Details

#initialize(aspect, file_manager) ⇒ PresentationApp

Returns a new instance of PresentationApp.



7
8
9
10
# File 'lib/rhet-butler/web/presentation-app.rb', line 7

def initialize(aspect, file_manager)
  @file_manager = file_manager
  @aspect = aspect
end

Instance Method Details

#assets_valiseObject



28
29
30
# File 'lib/rhet-butler/web/presentation-app.rb', line 28

def assets_valise
  @file_manager.base_assets(configuration.template_cache)
end

#bodyObject



43
44
45
# File 'lib/rhet-butler/web/presentation-app.rb', line 43

def body
  html_generator.render(configuration.root_slide_template)
end

#call(env) ⇒ Object



47
48
49
# File 'lib/rhet-butler/web/presentation-app.rb', line 47

def call(env)
  [200, {'Content-Type' => "text/html"}, [body]]
end

#configurationObject



12
13
14
# File 'lib/rhet-butler/web/presentation-app.rb', line 12

def configuration
  @file_manager.aspect_config(@aspect)
end

#html_generatorObject



37
38
39
40
41
# File 'lib/rhet-butler/web/presentation-app.rb', line 37

def html_generator
  generator = HTMLGenerator.new(configuration, template_handler)
  generator.root_step = root_step
  generator
end

#root_stepObject



32
33
34
35
# File 'lib/rhet-butler/web/presentation-app.rb', line 32

def root_step
  slide_loader = SlideLoader.new(slides_valise, assets_valise, configuration)
  slide_loader.load_slides
end

#slides_valiseObject



24
25
26
# File 'lib/rhet-butler/web/presentation-app.rb', line 24

def slides_valise
  @file_manager.slide_files
end

#template_cacheObject



16
17
18
# File 'lib/rhet-butler/web/presentation-app.rb', line 16

def template_cache
  ::Tilt::Cache.new
end

#template_handlerObject



20
21
22
# File 'lib/rhet-butler/web/presentation-app.rb', line 20

def template_handler
  @file_manager.aspect_templates(@aspect, template_cache)
end