Class: Tmdb::Api

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/themoviedb/api.rb

Class Method Summary collapse

Class Method Details

.configObject


9
10
11
# File 'lib/themoviedb/api.rb', line 9

def self.config
  @@config ||= {}
end

.etag(etag) ⇒ Object


25
26
27
# File 'lib/themoviedb/api.rb', line 25

def self.etag(etag)
  headers 'If-None-Match' => '"' + etag + '"'
end

.key(api_key) ⇒ Object


13
14
15
# File 'lib/themoviedb/api.rb', line 13

def self.key(api_key)
  self.config[:api_key] = api_key
end

.language(lang) ⇒ Object


17
18
19
20
21
22
23
# File 'lib/themoviedb/api.rb', line 17

def self.language(lang)
  if (lang.nil?)
    self.config.delete(:language)
  else
    self.config[:language] = lang
  end
end

.responseObject


29
30
31
# File 'lib/themoviedb/api.rb', line 29

def self.response
  @@response ||= {}
end

.set_response(hash) ⇒ Object


33
34
35
# File 'lib/themoviedb/api.rb', line 33

def self.set_response(hash)
  @@response = hash
end