Class: Zelda::Serie

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Zelda::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zelda::Base

Class Method Details

.allObject



13
14
15
# File 'lib/zelda/serie.rb', line 13

def all
  Request.get("series")
end

.find(id) ⇒ Object



8
9
10
11
# File 'lib/zelda/serie.rb', line 8

def find(id)
  attrs = Request.get("series/#{id}")['serie'] rescue nil
  attrs ? new(attrs) : nil
end

.search(query) ⇒ Object



4
5
6
# File 'lib/zelda/serie.rb', line 4

def search(query)
  Request.get("series/search/#{query}")['series']
end

Instance Method Details

#afleveringen(van = nil, tot = nil) ⇒ Object



18
19
20
# File 'lib/zelda/serie.rb', line 18

def afleveringen(van=nil, tot=nil)
  get_afleveringen(:van => van, :tot => tot)
end

#past_afleveringenObject



26
27
28
# File 'lib/zelda/serie.rb', line 26

def past_afleveringen
  get_afleveringen(:collection => "past")
end

#upcoming_afleveringenObject



22
23
24
# File 'lib/zelda/serie.rb', line 22

def upcoming_afleveringen
  get_afleveringen(:collection => "upcoming")
end