Class: Docks::Templates::Template
- Inherits:
-
Object
- Object
- Docks::Templates::Template
- Defined in:
- lib/docks/templates.rb
Instance Attribute Summary collapse
-
#layout ⇒ Object
readonly
Returns the value of attribute layout.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Template
constructor
A new instance of Template.
- #matches?(id) ⇒ Boolean
Constructor Details
#initialize(name, options = {}) ⇒ Template
Returns a new instance of Template.
10 11 12 13 14 |
# File 'lib/docks/templates.rb', line 10 def initialize(name, = {}) @path = name @matcher = [:matches] || [:for] @layout = [:layout] end |
Instance Attribute Details
#layout ⇒ Object (readonly)
Returns the value of attribute layout.
4 5 6 |
# File 'lib/docks/templates.rb', line 4 def layout @layout end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/docks/templates.rb', line 4 def path @path end |
Class Method Details
.new(name, options = {}) ⇒ Object
6 7 8 |
# File 'lib/docks/templates.rb', line 6 def self.new(name, = {}) name.kind_of?(self) ? name : super end |
Instance Method Details
#matches?(id) ⇒ Boolean
20 21 22 |
# File 'lib/docks/templates.rb', line 20 def matches?(id) !(@matcher =~ id).nil? end |