Class: TreeRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_renderer.rb,
lib/tree_renderer/version.rb

Constant Summary collapse

VERSION =
"1.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_path, target_path, variables = {}) ⇒ TreeRenderer

Returns a new instance of TreeRenderer



14
15
16
17
18
# File 'lib/tree_renderer.rb', line 14

def initialize(template_path, target_path, variables = {})
  @template_path = template_path
  @target_path   = target_path
  @var_binding   = calculate_binding(variables)
end

Instance Attribute Details

#target_pathObject (readonly)

Returns the value of attribute target_path



12
13
14
# File 'lib/tree_renderer.rb', line 12

def target_path
  @target_path
end

#template_pathObject (readonly)

Returns the value of attribute template_path



12
13
14
# File 'lib/tree_renderer.rb', line 12

def template_path
  @template_path
end

#var_bindingObject (readonly)

Returns the value of attribute var_binding



12
13
14
# File 'lib/tree_renderer.rb', line 12

def var_binding
  @var_binding
end

Instance Method Details

#saveObject



20
21
22
# File 'lib/tree_renderer.rb', line 20

def save
  all_files.each{ |file| parse_and_save(file) }
end