Class: Stevenson::Template::Loader
- Inherits:
-
Object
- Object
- Stevenson::Template::Loader
- Defined in:
- lib/stevenson/template/loader.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#template_name ⇒ Object
readonly
Returns the value of attribute template_name.
Instance Method Summary collapse
-
#initialize(template_name, options) ⇒ Loader
constructor
A new instance of Loader.
- #template ⇒ Object
- #template_klass ⇒ Object
Constructor Details
#initialize(template_name, options) ⇒ Loader
Returns a new instance of Loader.
6 7 8 |
# File 'lib/stevenson/template/loader.rb', line 6 def initialize(template_name, ) @template_name, = template_name, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/stevenson/template/loader.rb', line 4 def end |
#template_name ⇒ Object (readonly)
Returns the value of attribute template_name.
4 5 6 |
# File 'lib/stevenson/template/loader.rb', line 4 def template_name @template_name end |
Instance Method Details
#template ⇒ Object
10 11 12 13 14 |
# File 'lib/stevenson/template/loader.rb', line 10 def template return Template.load(matching_alias.name, matching_alias.) if matching_alias? template_klass.new template_name, end |
#template_klass ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/stevenson/template/loader.rb', line 16 def template_klass case template_name when /^.*\.git$/ Template::Git else Template::Local end end |