Class: Rapid::Template::Node::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rapid/template/node/base.rb

Direct Known Subclasses

CommentNode, IfNode, Root, Static, Variable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
# File 'lib/rapid/template/node/base.rb', line 9

def initialize
  
end

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



7
8
9
# File 'lib/rapid/template/node/base.rb', line 7

def parent
  @parent
end

Instance Method Details

#contentObject



29
30
31
# File 'lib/rapid/template/node/base.rb', line 29

def content
  
end

#next_nodeObject



21
22
23
# File 'lib/rapid/template/node/base.rb', line 21

def next_node
  parent.next_to self if parent
end

#next_to(child) ⇒ Object



17
18
19
# File 'lib/rapid/template/node/base.rb', line 17

def next_to child
  # subclasses fill this in
end

#pull(result) ⇒ Object

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/rapid/template/node/base.rb', line 13

def pull result
  raise NotImplementedError.new("pull not implemented for #{self.class}")
end

#static?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rapid/template/node/base.rb', line 25

def static?
  is_a? Static
end