Class: Vedeu::Template
- Inherits:
-
Object
- Object
- Vedeu::Template
- Defined in:
- lib/vedeu/support/template.rb
Overview
Generic class to loading a template and parsing it via ERb.
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
private
Returns the value of attribute object.
-
#path ⇒ Object
readonly
private
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(object, path) ⇒ Template constructor
- #load ⇒ String private
- #parse ⇒ void
Constructor Details
#initialize(object, path) ⇒ Template
19 20 21 |
# File 'lib/vedeu/support/template.rb', line 19 def initialize(object, path) @object, @path = object, path end |
Instance Attribute Details
#object ⇒ Object (readonly, private)
Returns the value of attribute object.
30 31 32 |
# File 'lib/vedeu/support/template.rb', line 30 def object @object end |
#path ⇒ Object (readonly, private)
Returns the value of attribute path.
30 31 32 |
# File 'lib/vedeu/support/template.rb', line 30 def path @path end |
Class Method Details
.parse(object, path) ⇒ void
This method returns an undefined value.
12 13 14 |
# File 'lib/vedeu/support/template.rb', line 12 def self.parse(object, path) new(object, path).parse end |
Instance Method Details
#load ⇒ String (private)
33 34 35 |
# File 'lib/vedeu/support/template.rb', line 33 def load File.read(path) end |
#parse ⇒ void
This method returns an undefined value.
24 25 26 |
# File 'lib/vedeu/support/template.rb', line 24 def parse ERB.new(load, nil, '-').result(binding) end |