Class: YaCan::Dependency::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/yacan/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Result

Returns a new instance of Result.



17
18
19
20
21
22
# File 'lib/yacan/dependency.rb', line 17

def initialize(xml)
  @xml = xml
  xml_chunks = Nokogiri::XML(xml).search('Chunk')
  @chunks = xml_chunks.map{ |c| Chunk.new(c, lambda{ @chunks }) }
  @morphems = chunks.map{|c| c.morphems}.flatten
end

Instance Attribute Details

#chunksObject (readonly)

Returns the value of attribute chunks.



24
25
26
# File 'lib/yacan/dependency.rb', line 24

def chunks
  @chunks
end

#morphemsObject (readonly)

Returns the value of attribute morphems.



24
25
26
# File 'lib/yacan/dependency.rb', line 24

def morphems
  @morphems
end

#xmlObject (readonly)

Returns the value of attribute xml.



24
25
26
# File 'lib/yacan/dependency.rb', line 24

def xml
  @xml
end