Class: LaTeXProjectTemplate::ErbObject
- Inherits:
-
Object
- Object
- LaTeXProjectTemplate::ErbObject
- Defined in:
- lib/latex_project_template.rb
Instance Attribute Summary collapse
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
Instance Method Summary collapse
- #component(name) ⇒ Object
-
#initialize(project_name, variables, config) ⇒ ErbObject
constructor
A new instance of ErbObject.
Constructor Details
#initialize(project_name, variables, config) ⇒ ErbObject
Returns a new instance of ErbObject.
196 197 198 199 200 201 202 203 204 205 |
# File 'lib/latex_project_template.rb', line 196 def initialize(project_name, variables, config) @project_name = project_name @__config = config variables.each do |key, val| instance_variable_set("@#{key}", val) self.class.class_eval do attr_reader key.intern end end end |
Instance Attribute Details
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
194 195 196 |
# File 'lib/latex_project_template.rb', line 194 def project_name @project_name end |
Instance Method Details
#component(name) ⇒ Object
207 208 209 210 211 212 213 |
# File 'lib/latex_project_template.rb', line 207 def component(name) if c = @__config.component(name) c.evaluate(self) else '' end end |