Class: TVDB::Series

Inherits:
Object
  • Object
show all
Defined in:
lib/tvdb_client/series.rb,
lib/tvdb_client/series/base.rb,
lib/tvdb_client/series/series_filter.rb,
lib/tvdb_client/series/series_images.rb,
lib/tvdb_client/series/series_episodes.rb

Defined Under Namespace

Classes: Base, Episodes, Filter, Images

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, series_id, options = {}) ⇒ Series

Returns a new instance of Series.



6
7
8
9
10
11
12
13
# File 'lib/tvdb_client/series.rb', line 6

def initialize( connection, series_id, options = {} )
  @connection = connection
  @series_id  = series_id
  @route      = "/series/#{series_id}"

  set_subtype_parameters
  get_series( series_id, options )
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#connectionObject

Returns the value of attribute connection.



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

def connection
  @connection
end

#dataObject (readonly)

Returns the value of attribute data.



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

def data
  @data
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#routeObject (readonly)

Returns the value of attribute route.



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

def route
  @route
end

#series_idObject (readonly)

Returns the value of attribute series_id.



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

def series_id
  @series_id
end

Instance Method Details

#all_episodesObject



33
34
35
36
# File 'lib/tvdb_client/series.rb', line 33

def all_episodes
  tr = TVDB::Service::Threading::ThreadedRequest.new( connection: connection )
  tr.make_request( "#{route}/episodes" )
end

#episodes(options = {}) ⇒ Object



15
16
17
18
19
# File 'lib/tvdb_client/series.rb', line 15

def episodes( options = {} )
  set_subtype_parameters( options )

  TVDB::Series::Episodes.new( params )
end

#filter(options = {}) ⇒ Object



27
28
29
30
31
# File 'lib/tvdb_client/series.rb', line 27

def filter( options = {} )
  set_subtype_parameters( options )

  TVDB::Series::Filter.new( params )
end

#images(options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/tvdb_client/series.rb', line 21

def images( options = {} )
  set_subtype_parameters( options )

  TVDB::Series::Images.new( params )
end