Class: Veewee::Template
- Inherits:
-
Object
- Object
- Veewee::Template
- Defined in:
- lib/veewee/template.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(name, path, env) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(name, path, env) ⇒ Template
Returns a new instance of Template.
8 9 10 11 12 13 |
# File 'lib/veewee/template.rb', line 8 def initialize(name, path, env) @name = name @path = path @env = env return self end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
4 5 6 |
# File 'lib/veewee/template.rb', line 4 def env @env end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/veewee/template.rb', line 6 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/veewee/template.rb', line 6 def path @path end |
Instance Method Details
#exists? ⇒ Boolean
15 16 17 18 19 20 21 22 23 |
# File 'lib/veewee/template.rb', line 15 def exists? filename = Dir.glob("#{path}/definition.rb") if filename.length != 0 env.logger.debug("[Template] template '#{name}' is valid") return true else return false end end |