Class: Flatrack::Template
- Inherits:
-
Object
- Object
- Flatrack::Template
- Defined in:
- lib/flatrack/template.rb,
lib/flatrack/template/rb.rb,
lib/flatrack/template/html.rb,
lib/flatrack/template/erubis.rb,
lib/flatrack/template/erubis/handler.rb
Overview
The default template parser/finder
Defined Under Namespace
Constant Summary collapse
- DEFAULT_FORMAT =
'html'
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.find(type, format, file) ⇒ Object
Creates a new template instance and invokes find.
Instance Method Summary collapse
-
#initialize(type, format, file) ⇒ Template
constructor
Creates a new template instance.
Constructor Details
#initialize(type, format, file) ⇒ Template
Creates a new template instance
27 28 29 30 31 |
# File 'lib/flatrack/template.rb', line 27 def initialize(type, format, file) @format = format || DEFAULT_FORMAT @type, @file = type, file.to_s @renderer = find end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
12 13 14 |
# File 'lib/flatrack/template.rb', line 12 def file @file end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
12 13 14 |
# File 'lib/flatrack/template.rb', line 12 def format @format end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/flatrack/template.rb', line 12 def type @type end |
Class Method Details
.find(type, format, file) ⇒ Object
Creates a new template instance and invokes find
19 20 21 |
# File 'lib/flatrack/template.rb', line 19 def self.find(type, format, file) new(type, format, file) end |