Sha256: 1d7e8228492960840162a82dfa7d77d953edbd4bafc6e65ae1925b31b2bd0e92

Contents?: true

Size: 497 Bytes

Versions: 2

Compression:

Stored size: 497 Bytes

Contents

# config.rb

module TMDB
  class API
    include HTTParty

    @@api_key = ''

    base_uri 'http://api.themoviedb.org'

    def self.api_key
      @@api_key
    end

    def self.api_key=(key)
      @@api_key = key
    end

    def self.config
      options = { api_key: self.api_key }
      response = TMDB::API.get("/3/configuration", query: options).parsed_response
      OpenStruct.new(response)
      # configuration['images']['base_url'] => "http://image.tmdb.org/t/p/" 
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tmdb-0.2.1 lib/tmdb/api.rb
tmdb-0.2.0 lib/tmdb/api.rb