Class: Mech::Compiler::Format
- Inherits:
-
Object
- Object
- Mech::Compiler::Format
show all
- Includes:
- Mech::Configurator
- Defined in:
- lib/mech.rb,
lib/mech/compiler/format.rb
Defined Under Namespace
Classes: ActionScript, Cl, JavaScript, Ruby, Scala, Yaml
Instance Method Summary
collapse
#config, #init
Constructor Details
#initialize(*args) ⇒ Format
Returns a new instance of Format.
11
12
13
|
# File 'lib/mech/compiler/format.rb', line 11
def initialize(*args)
@data = {}
end
|
Instance Method Details
#compile(data, params = {}, &block) ⇒ Object
7
8
9
|
# File 'lib/mech/compiler/format.rb', line 7
def compile(data, params = {}, &block)
raise 'Compile method not exist'
end
|
#output ⇒ Object
23
24
25
|
# File 'lib/mech/compiler/format.rb', line 23
def output
@data
end
|
#tmp_path ⇒ Object
19
20
21
|
# File 'lib/mech/compiler/format.rb', line 19
def tmp_path
raise 'Not defined tmp path'
end
|
#with_template ⇒ Object
15
16
17
|
# File 'lib/mech/compiler/format.rb', line 15
def with_template
ERB.new(File.read(tmp_path)).result(binding)
end
|