Class: MyEpisodes::TableParser

Inherits:
Object
  • Object
show all
Defined in:
lib/my_episodes/table_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ TableParser

Returns a new instance of TableParser.



5
6
7
8
# File 'lib/my_episodes/table_parser.rb', line 5

def initialize(options={})
	@options = options
	@search_string = 'table.mylist tr'.freeze
end

Instance Method Details

#parse(page) ⇒ Object



10
11
12
13
14
# File 'lib/my_episodes/table_parser.rb', line 10

def parse(page)
	table = page.search(@search_string)
	table.shift unless @options[:keep_header]
	table
end