Class: Nokaya::Movie

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

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 = {}) ⇒ Movie

Returns a new instance of Movie.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/nokaya/movie.rb', line 10

def initialize args, options = {}
  super(args, options)
  @type = :movie
  begin
    resp = Spotlite::Movie.find(@args.join(' '))
  rescue SocketError
    Logs.rec.error 'No connexion'
    return nil
  end
  @options['alt'] ? res = resp[1] : res = resp[0]
  @title = res.title
  @ref_url = res.url
  @year = res.year
  @urls = [res.poster_url]
  @filenames = name_files()
end

Instance Attribute Details

#ref_urlObject (readonly)

Returns the value of attribute ref_url.



8
9
10
# File 'lib/nokaya/movie.rb', line 8

def ref_url
  @ref_url
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/nokaya/movie.rb', line 8

def title
  @title
end

#yearObject (readonly)

Returns the value of attribute year.



8
9
10
# File 'lib/nokaya/movie.rb', line 8

def year
  @year
end