Class: AudioPage

Inherits:
ItemsPage show all
Defined in:
lib/etvnet_seek/core/audio_page.rb

Constant Summary collapse

AUDIO_URL =
BASE_URL + "/audio/"

Constants inherited from Page

Page::BASE_URL

Instance Attribute Summary

Attributes inherited from Page

#document

Attributes inherited from ServiceCall

#url

Instance Method Summary collapse

Methods inherited from ItemsPage

#categories, #category_breadcrumbs, #description, #navigation_menu, #page_browser, #page_title, #see_too_items, #title, #title_items

Methods inherited from ServiceCall

#get, #post

Constructor Details

#initialize(url = AUDIO_URL) ⇒ AudioPage

Returns a new instance of AudioPage.



7
8
9
# File 'lib/etvnet_seek/core/audio_page.rb', line 7

def initialize url = AUDIO_URL
  super(url)
end

Instance Method Details

#itemsObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/etvnet_seek/core/audio_page.rb', line 11

def items
  list = []

  document.css("#nav a").each do |item|
    text = item.css("span").text.strip
    href = item['href']

    unless href == '/' or href =~ /(press|register|persons)/
      list << MediaItem.new(text, href)
    end
  end

  list
end