Method: TheGrid::Builder.call

Defined in:
lib/the_grid/builder.rb

.call(template) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/the_grid/builder.rb', line 9

def self.call(template)
  source = if template.source.empty?
    File.read(template.identifier)
  else
    template.source
  end

  %{
    ::TheGrid::Builder.assemble(:format => #{template.formats.first.inspect}, :scope => self) {
      #{source}
    }
  }
end