Class: Ariel::ExtractedNode

Inherits:
Object
  • Object
show all
Includes:
NodeLike
Defined in:
lib/ariel/extracted_node.rb

Overview

Each ExtractedNode has a name, a tokenstream and a structure which points to the relevant StructureNode.

Instance Attribute Summary collapse

Attributes included from NodeLike

#children, #meta, #parent

Instance Method Summary collapse

Methods included from NodeLike

#add_child, #each_descendant

Constructor Details

#initialize(name, tokenstream, structure) ⇒ ExtractedNode

Returns a new instance of ExtractedNode.



10
11
12
13
14
# File 'lib/ariel/extracted_node.rb', line 10

def initialize(name, tokenstream, structure)
  @children={}
  @meta = OpenStruct.new({:name=>name, :structure=>structure})
  @tokenstream=tokenstream
end

Instance Attribute Details

#tokenstreamObject

Returns the value of attribute tokenstream.



8
9
10
# File 'lib/ariel/extracted_node.rb', line 8

def tokenstream
  @tokenstream
end

Instance Method Details

#extracted_textObject



16
17
18
# File 'lib/ariel/extracted_node.rb', line 16

def extracted_text
  tokenstream.text
end