Class: Pieces::RouteCompiler

Inherits:
Object
  • Object
show all
Includes:
Configurable
Defined in:
lib/pieces/route_compiler.rb

Defined Under Namespace

Classes: ViewModel

Instance Attribute Summary

Attributes included from Configurable

#config

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ RouteCompiler

Returns a new instance of RouteCompiler.



7
8
9
# File 'lib/pieces/route_compiler.rb', line 7

def initialize(config)
  @config = config
end

Instance Method Details

#compile(files, name, route) ⇒ Object



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

def compile(files, name, route)
  files.merge("#{name}.html" => { contents: yield_pieces(route), type: 'html' })
end