Class: Nokaya::TVShow

Inherits:
Basic
  • Object
show all
Defined in:
lib/nokaya/tvshow.rb

Constant Summary collapse

NOKAYA_TVDB_API_KEY =
'C9493DA27231C706'

Instance Attribute Summary collapse

Attributes inherited from Basic

#args, #filenames, #name, #options, #path, #type, #urls

Instance Method Summary collapse

Methods inherited from Basic

#get_basic, #parse, #save

Constructor Details

#initialize(args, options = {}) ⇒ TVShow

Returns a new instance of TVShow.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/nokaya/tvshow.rb', line 12

def initialize(args, options = {})
  super(args, options)
  @type = :tvshow
  @language = 'en'
  begin
    @tvdb = TvdbParty::Search.new(NOKAYA_TVDB_API_KEY)
  rescue SocketError
    Logs.rec.error Status.no_cnx
    return nil
  end
  terms = args.join(' ')
  show_obj = find(terms, options)
  return nil if show_obj.nil?
  create_details(show_obj)
  @urls = [@poster_url, @banner_url]
  @filenames = name_files()
end

Instance Attribute Details

Returns the value of attribute banner_url.



10
11
12
# File 'lib/nokaya/tvshow.rb', line 10

def banner_url
  @banner_url
end

#languageObject

Returns the value of attribute language.



10
11
12
# File 'lib/nokaya/tvshow.rb', line 10

def language
  @language
end

#plotObject

Returns the value of attribute plot.



10
11
12
# File 'lib/nokaya/tvshow.rb', line 10

def plot
  @plot
end

#poster_urlObject

Returns the value of attribute poster_url.



10
11
12
# File 'lib/nokaya/tvshow.rb', line 10

def poster_url
  @poster_url
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/nokaya/tvshow.rb', line 10

def title
  @title
end