Class: Zelda::Zender

Inherits:
Base
  • Object
show all
Defined in:
lib/zelda/zender.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 Zenders.



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

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

.find(code) ⇒ Object

Find a Zender by code, such as NL1 or 101.



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

def find(code)
  response = Request.get("zenders/#{code}")
  response ? new(response['zender']) : nil
end

Instance Method Details

#current_seriesObject

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



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

def current_series
  Zelda::Request.get("zenders/#{id}/current_series")['zender']['series']['serie'].map do |attrs|
    Zelda::Serie.new(attrs)
  end
end

#seriesObject

Return all Series for this Zender.



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

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

#to_sObject



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

def to_s
  name
end