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



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

def initialize(xpath)
  @xpath = xpath
end

Instance Attribute Details

#xpathObject (readonly)

xpath to getting the data from



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

def xpath
  @xpath
end

Class Method Details

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

Returns parsed responses.

Parameters:

Returns:

  • (Array<Hash>)

    parsed responses



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

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