Class: Tsumamigui::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/tsumamigui/parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xpath) ⇒ Parser

Returns a new instance of Parser.

Parameters:

  • xpath (Hash)

    Name and xpath to it


18
19
20
# File 'lib/tsumamigui/parser.rb', line 18

def initialize(xpath)
  @xpath = xpath
end

Instance Attribute Details

#xpathObject (readonly)

Returns the value of attribute xpath


6
7
8
# File 'lib/tsumamigui/parser.rb', line 6

def xpath
  @xpath
end

Class Method Details

.parse(responses, xpath) ⇒ Array<Hash>

Parameters:

Returns:

  • (Array<Hash>)

12
13
14
# File 'lib/tsumamigui/parser.rb', line 12

def parse(responses, xpath)
  new(xpath).send(:parse, responses)
end