Class: SpielplanSaar::ResultPageParser

Inherits:
Object
  • Object
show all
Defined in:
lib/spielplan_saar/result_page_parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html_content) ⇒ ResultPageParser

Returns a new instance of ResultPageParser.



8
9
10
# File 'lib/spielplan_saar/result_page_parser.rb', line 8

def initialize(html_content)
  @html_content = html_content
end

Instance Attribute Details

#html_contentObject (readonly)

Returns the value of attribute html_content.



6
7
8
# File 'lib/spielplan_saar/result_page_parser.rb', line 6

def html_content
  @html_content
end

Class Method Details

.parse(html_content) ⇒ Object



12
13
14
# File 'lib/spielplan_saar/result_page_parser.rb', line 12

def self.parse(html_content)
  self.new(html_content).parse
end

Instance Method Details

#parseObject



16
17
18
# File 'lib/spielplan_saar/result_page_parser.rb', line 16

def parse
  OpenStruct.new(:table => TableParser.new(html_content).parse)
end