Class: Kojo::Collection
- Inherits:
-
Object
- Object
- Kojo::Collection
- Defined in:
- lib/kojo/collection.rb
Overview
The Collection class is a wrapper around the Template object. It provides a mechanism for processing an entire directory of templates.
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#import_base ⇒ Object
Returns the value of attribute import_base.
Instance Method Summary collapse
-
#initialize(dir) ⇒ Collection
constructor
A new instance of Collection.
- #render(args = {}, &block) ⇒ Object
Constructor Details
#initialize(dir) ⇒ Collection
Returns a new instance of Collection.
8 9 10 11 |
# File 'lib/kojo/collection.rb', line 8 def initialize(dir) @dir = dir @import_base = dir end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
5 6 7 |
# File 'lib/kojo/collection.rb', line 5 def dir @dir end |
#import_base ⇒ Object
Returns the value of attribute import_base.
6 7 8 |
# File 'lib/kojo/collection.rb', line 6 def import_base @import_base end |
Instance Method Details
#render(args = {}, &block) ⇒ Object
13 14 15 16 17 |
# File 'lib/kojo/collection.rb', line 13 def render(args={}, &block) files.each do |file| handle file, args, &block end end |