Class: MyEpisodes::TableParser
- Inherits:
-
Object
- Object
- MyEpisodes::TableParser
- Defined in:
- lib/my_episodes/table_parser.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TableParser
constructor
A new instance of TableParser.
- #parse(page) ⇒ Object
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 = @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 |