Class: RablRails::CompiledTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/rabl-rails/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompiledTemplate

Returns a new instance of CompiledTemplate.



5
6
7
8
9
# File 'lib/rabl-rails/template.rb', line 5

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

Instance Attribute Details

#cache_keyObject

Returns the value of attribute cache_key.



3
4
5
# File 'lib/rabl-rails/template.rb', line 3

def cache_key
  @cache_key
end

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/rabl-rails/template.rb', line 3

def data
  @data
end

#nodesObject

Returns the value of attribute nodes.



3
4
5
# File 'lib/rabl-rails/template.rb', line 3

def nodes
  @nodes
end

#root_nameObject

Returns the value of attribute root_name.



3
4
5
# File 'lib/rabl-rails/template.rb', line 3

def root_name
  @root_name
end

Instance Method Details

#add_node(n) ⇒ Object



16
17
18
# File 'lib/rabl-rails/template.rb', line 16

def add_node(n)
  @nodes << n
end

#extends(template) ⇒ Object



20
21
22
# File 'lib/rabl-rails/template.rb', line 20

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

#initialize_dup(other) ⇒ Object



11
12
13
14
# File 'lib/rabl-rails/template.rb', line 11

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