Class: P::Template
- Inherits:
-
Object
- Object
- P::Template
- Defined in:
- lib/p/template.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template, name) ⇒ Template
constructor
A new instance of Template.
- #variables ⇒ Object
Constructor Details
#initialize(template, name) ⇒ Template
Returns a new instance of Template.
7 8 9 10 11 12 |
# File 'lib/p/template.rb', line 7 def initialize(template, name) @template = template @path = find_template(template) @directory = File.join(File.dirname(@path), template) @name = name end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
5 6 7 |
# File 'lib/p/template.rb', line 5 def directory @directory end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/p/template.rb', line 5 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/p/template.rb', line 5 def path @path end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
5 6 7 |
# File 'lib/p/template.rb', line 5 def template @template end |
Instance Method Details
#variables ⇒ Object
14 15 16 |
# File 'lib/p/template.rb', line 14 def variables { name: name } end |