Class: Hologram::TemplateVariables

Inherits:
Object
  • Object
show all
Defined in:
lib/hologram/template_variables.rb

Overview

Helper class for binding things for ERB

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ TemplateVariables

Returns a new instance of TemplateVariables.



7
8
9
# File 'lib/hologram/template_variables.rb', line 7

def initialize(args)
  set_args(args)
end

Instance Attribute Details

#blocksObject

Returns the value of attribute blocks.



5
6
7
# File 'lib/hologram/template_variables.rb', line 5

def blocks
  @blocks
end

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/hologram/template_variables.rb', line 5

def config
  @config
end

#file_nameObject

Returns the value of attribute file_name.



5
6
7
# File 'lib/hologram/template_variables.rb', line 5

def file_name
  @file_name
end

#output_files_by_categoryObject

Returns the value of attribute output_files_by_category.



5
6
7
# File 'lib/hologram/template_variables.rb', line 5

def output_files_by_category
  @output_files_by_category
end

#pagesObject

Returns the value of attribute pages.



5
6
7
# File 'lib/hologram/template_variables.rb', line 5

def pages
  @pages
end

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/hologram/template_variables.rb', line 5

def title
  @title
end

Instance Method Details

#get_bindingObject



17
18
19
# File 'lib/hologram/template_variables.rb', line 17

def get_binding
  binding()
end

#set_args(args) ⇒ Object



11
12
13
14
15
# File 'lib/hologram/template_variables.rb', line 11

def set_args(args)
  args.each do |k,v|
    instance_variable_set("@#{k}", v)
  end
end