Class: EsiForRack::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/esi_for_rack/node.rb

Direct Known Subclasses

Choose, Include, Try, Vars

Defined Under Namespace

Classes: Choose, Context, Include, Try, Vars

Constant Summary collapse

IncludeFailedError =
Class.new(RuntimeError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



7
8
9
# File 'lib/esi_for_rack/node.rb', line 7

def context
  @context
end

#nodeObject (readonly)

Returns the value of attribute node.



7
8
9
# File 'lib/esi_for_rack/node.rb', line 7

def node
  @node
end

Instance Method Details

#execute_in_place!Object



15
16
17
# File 'lib/esi_for_rack/node.rb', line 15

def execute_in_place!
  node.replace(Nokogiri::XML::CDATA.new(node.document, execute.to_s))
end

#init(node, context) ⇒ Object



9
10
11
12
13
# File 'lib/esi_for_rack/node.rb', line 9

def init(node, context)
  @node = node
  @context = context
  self
end