Class: Tmdb::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/themoviedb/configuration.rb

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration


3
4
5
6
7
# File 'lib/themoviedb/configuration.rb', line 3

def initialize()
  @params = {}
  @resource = '/configuration'
  self
end

Instance Method Details

#backdrop_sizesObject


26
27
28
# File 'lib/themoviedb/configuration.rb', line 26

def backdrop_sizes
  images_config['backdrop_sizes']
end

#base_urlObject

To build an image URL, you will need 3 pieces of data. The base_url, size and file_path. Simply combine them all and you will have a fully qualified URL. Here’s an example URL:


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

def base_url
  images_config['base_url']
end

#fetch_responseObject


38
39
40
41
42
# File 'lib/themoviedb/configuration.rb', line 38

def fetch_response
  options = @params.merge(Api.config)
  response = Api.get(@resource, :query => options)
  response.to_hash
end

#logo_sizesObject


34
35
36
# File 'lib/themoviedb/configuration.rb', line 34

def logo_sizes
  images_config['logo_sizes']
end

#poster_sizesObject


22
23
24
# File 'lib/themoviedb/configuration.rb', line 22

def poster_sizes
  images_config['poster_sizes']
end

#profile_sizesObject


30
31
32
# File 'lib/themoviedb/configuration.rb', line 30

def profile_sizes
  images_config['profile_sizes']
end

#secure_base_urlObject

HTTPS


18
19
20
# File 'lib/themoviedb/configuration.rb', line 18

def secure_base_url
  images_config['secure_base_url']
end