Class: Newzcache::Series

Inherits:
Object
  • Object
show all
Defined in:
lib/newzcache/series.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, options = {}) ⇒ Series

Returns a new instance of Series.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/newzcache/series.rb', line 7

def initialize(client, options={})
  @client = client
  @poster_url = options["poster_url"]
  @runtime = options["runtime"]
  @rating = options["rating"]
  @title = options["title"]
  @first_aired = options["first_aired"]
  @id = options["id"]
  @network = options["network"]
  @recommended = options["recommended"]
  @poster_thumb_url = options["poster_thumb_url"]
  @banner_url = options["banner_url"]
  @description = options["description"]
  @genres = options["genres"].map{|result| Genre.new(result["genre"])}
end

Instance Attribute Details

Returns the value of attribute banner_url.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def banner_url
  @banner_url
end

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/newzcache/series.rb', line 3

def client
  @client
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def description
  @description
end

#first_airedObject

Returns the value of attribute first_aired.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def first_aired
  @first_aired
end

#genresObject

Returns the value of attribute genres.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def genres
  @genres
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def id
  @id
end

#networkObject

Returns the value of attribute network.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def network
  @network
end

#poster_thumb_urlObject

Returns the value of attribute poster_thumb_url.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def poster_thumb_url
  @poster_thumb_url
end

#poster_urlObject

Returns the value of attribute poster_url.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def poster_url
  @poster_url
end

#ratingObject

Returns the value of attribute rating.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def rating
  @rating
end

Returns the value of attribute recommended.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def recommended
  @recommended
end

#runtimeObject

Returns the value of attribute runtime.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def runtime
  @runtime
end

#seasonsObject

Returns the value of attribute seasons.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def seasons
  @seasons
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/newzcache/series.rb', line 4

def title
  @title
end

Instance Method Details

#season(season_number) ⇒ Object



27
28
29
# File 'lib/newzcache/series.rb', line 27

def season(season_number)
  seasons.detect{|s| s.number == season_number}
end