Class: ChannelsPage
- Inherits:
-
ItemsPage
- Object
- ServiceCall
- Page
- ItemsPage
- ChannelsPage
- Defined in:
- lib/etvnet_seek/core/channels_page.rb
Constant Summary collapse
Constants inherited from Page
Instance Attribute Summary
Attributes inherited from Page
Attributes inherited from ServiceCall
Instance Method Summary collapse
-
#initialize(url = CHANNELS_URL) ⇒ ChannelsPage
constructor
A new instance of ChannelsPage.
- #items ⇒ Object
Methods inherited from ItemsPage
#categories, #category_breadcrumbs, #description, #navigation_menu, #page_browser, #page_title, #see_too_items, #title, #title_items
Methods inherited from ServiceCall
Constructor Details
#initialize(url = CHANNELS_URL) ⇒ ChannelsPage
Returns a new instance of ChannelsPage.
8 9 10 |
# File 'lib/etvnet_seek/core/channels_page.rb', line 8 def initialize url = CHANNELS_URL super(url) end |
Instance Method Details
#items ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/etvnet_seek/core/channels_page.rb', line 12 def items list = [] document.css("#table-onecolumn-kanali tr").each do |item| links = item.css("td a") text = item.children.at(0).text.strip href = links[0] catalog_href = links[1] link = href.attributes['href'].value catalog_link = catalog_href.attributes['href'].value list << ChannelMediaItem.new(text, link, catalog_link) end list end |