Class: Zelda::Omroep

Inherits:
Base
  • Object
show all
Defined in:
lib/zelda/omroep.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Zelda::Base

Class Method Details

.allObject

Find all omroepen.



11
12
13
# File 'lib/zelda/omroep.rb', line 11

def all
  Request.get("omroepen")['omroepen']
end

.find(slug) ⇒ Object

Find an omroep by slug, such as kro.



5
6
7
8
# File 'lib/zelda/omroep.rb', line 5

def find(slug)
  response = Request.get("omroepen/#{slug}")
  response ? new(response['omroep']) : nil
end

Instance Method Details

#current_seriesObject

Return Series for this Omroep that have broadcasts in the future.



28
29
30
31
32
# File 'lib/zelda/omroep.rb', line 28

def current_series
  Zelda::Request.get("omroepen/#{slug}/current_series")['omroep']['current_series']['serie'].map do |attrs|
    Zelda::Serie.new(attrs)
  end
end

#seriesObject

Return all Series for this Omroep.



21
22
23
24
25
# File 'lib/zelda/omroep.rb', line 21

def series
  Zelda::Request.get("omroepen/#{slug}/series")['omroep']['series']['serie'].map do |attrs|
    Zelda::Serie.new(attrs)
  end
end

#to_sObject



16
17
18
# File 'lib/zelda/omroep.rb', line 16

def to_s
  name
end