Class: Rapid::Template::Node::Static

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

Instance Attribute Summary collapse

Attributes inherited from Base

#parent

Instance Method Summary collapse

Methods inherited from Base

#next_node, #next_to, #static?

Constructor Details

#initialize(content) ⇒ Static

Returns a new instance of Static.



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

def initialize content
  @content = content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#==(obj) ⇒ Object



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

def == obj
  obj.is_a?(self.class) && obj.content == @content
end

#inspectObject



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

def inspect
  %(#<static #{@content.inspect}>)
end

#pull(result) ⇒ Object



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

def pull result
  result.match! @content
end