File: template.rb

package info (click to toggle)
ruby-rabl-rails 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 268 kB
  • ctags: 179
  • sloc: ruby: 1,480; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module RablRails
  class CompiledTemplate
    attr_accessor :nodes, :data, :root_name, :cache_key

    def initialize
      @nodes = []
      @cache_key = false
    end

    def initialize_dup(other)
      super
      self.nodes = other.nodes.dup
    end

    def add_node(n)
      @nodes << n
    end

    def extends(template)
      @nodes.concat template.nodes
    end
  end
end