Class: Kojo::Collection

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#dirObject (readonly)

Returns the value of attribute dir.



5
6
7
# File 'lib/kojo/collection.rb', line 5

def dir
  @dir
end

#import_baseObject

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