tmdb_rexx 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54b38fe1c487845a60e81c848d8598c6e3eb739e
4
- data.tar.gz: f05209aa604706fea77a3f8d6ba821b3caef181d
3
+ metadata.gz: 58fc57b84c85cb31961c44f559bd5c7eda283199
4
+ data.tar.gz: ab6306bac453b4eb6e9344a8f0865032dab204bc
5
5
  SHA512:
6
- metadata.gz: 12b917c3d1555f31e39197e60d7f0b1a93b54355f9c99f6878eb6df3893971f6a56c5f86db9f74f005572dbdfe091c1b6ca46933ad13e4a7d17bee0b07c35d8a
7
- data.tar.gz: 31f34dcfe3bcfabae5d39e040c0ca254f33ad13ae7528a380a81c2548c4497e1ab4bc2f6ddcba83841560af7b2ecea8f8ce2bd74b616a0866a0753fa26b47e4a
6
+ metadata.gz: 9e1b7529dc9d79158e3d85ee5973ff3676448bf59736783d1185cc2bc8657427873613b82c9238d516331e390dae75dac8ec7b22eaf46f7e2a55808cdb7217de
7
+ data.tar.gz: 842e49daaadf1a68fa7ec0a8dbb054b1934ee82aa20b585292702b6e91548f61a43ecf8e6a9928807ca76fa699e7abcc0352592536a574eb0aaf2f9d0db956b8
@@ -207,7 +207,7 @@ module TmdbRexx
207
207
  #
208
208
  # @example Get the movie latest
209
209
  # TmdbRexx::Client.latest_movie("movie-id")
210
- def latest_movie(movie_id, options = {})
210
+ def latest_movie(options = {})
211
211
  get([RESOURCE, "latest"].join("/"), options)
212
212
  end
213
213
 
@@ -221,7 +221,7 @@ module TmdbRexx
221
221
  #
222
222
  # @example Get the movies now_playing
223
223
  # TmdbRexx::Client.now_playing("movie-id")
224
- def now_playing(movie_id, options = {})
224
+ def now_playing(options = {})
225
225
  get([RESOURCE, "now_playing"].join("/"), options)
226
226
  end
227
227
 
@@ -235,7 +235,7 @@ module TmdbRexx
235
235
  #
236
236
  # @example Get the movies popular_movies
237
237
  # TmdbRexx::Client.popular_movies("movie-id")
238
- def popular_movies(movie_id, options = {})
238
+ def popular_movies(options = {})
239
239
  get([RESOURCE, "popular"].join("/"), options)
240
240
  end
241
241
 
@@ -249,7 +249,7 @@ module TmdbRexx
249
249
  #
250
250
  # @example Get the movies top rated
251
251
  # TmdbRexx::Client.top_rated_movies("movie-id")
252
- def top_rated_movies(movie_id, options = {})
252
+ def top_rated_movies(options = {})
253
253
  get([RESOURCE, "top_rated"].join("/"), options)
254
254
  end
255
255
 
@@ -263,7 +263,7 @@ module TmdbRexx
263
263
  #
264
264
  # @example Get the movies upcoming
265
265
  # TmdbRexx::Client.upcoming("movie-id")
266
- def upcoming(movie_id, options = {})
266
+ def upcoming(options = {})
267
267
  get([RESOURCE, "upcoming"].join("/"), options)
268
268
  end
269
269
  end
@@ -2,8 +2,7 @@ module TmdbRexx
2
2
  module Configuration
3
3
  VALID_OPTION_KEYS = %i(api_key base_url version include_adult language).freeze
4
4
 
5
- #attr_accessor(*VALID_OPTION_KEYS)
6
- attr_accessor :api_key, :base_url, :version, :include_adult, :language
5
+ attr_accessor(*VALID_OPTION_KEYS)
7
6
 
8
7
  class << self
9
8
  def keys
@@ -18,7 +17,10 @@ module TmdbRexx
18
17
  # Reset configuration options to default values
19
18
  def reset!
20
19
  TmdbRexx::Configuration.keys.each do |key|
21
- instance_variable_set(:"@#{key}", TmdbRexx::Default.options[key])
20
+ instance_variable_set(
21
+ :"@#{key}",
22
+ TmdbRexx::Default.const_get(key.upcase)
23
+ )
22
24
  end
23
25
  self
24
26
  end
@@ -1,6 +1,7 @@
1
1
  module TmdbRexx
2
2
  # Default configuration for {Client}
3
3
  module Default
4
+ API_KEY = nil
4
5
  BASE_URL = "https://api.themoviedb.org".freeze
5
6
  VERSION = 3
6
7
  INCLUDE_ADULT = false
@@ -9,45 +10,38 @@ module TmdbRexx
9
10
  # Default API endpoint built from the base url and version
10
11
  # @return [String]
11
12
  def api_endpoint
12
- "#{@base_url}/#{@version}"
13
+ "#{base_url}/#{version}"
13
14
  end
14
15
 
15
- class << self
16
- # Configuration options
17
- # @return [Hash]
18
- def options
19
- Hash[TmdbRexx::Configuration.keys.map{|key| [key, send(key)]}]
20
- end
21
-
22
- # Default api_key key from ENV
23
- # @return [String]
24
- def api_key
25
- ENV['MOVIEREXX_API_KEY'] || @api_key
26
- end
16
+ # Default api_key key from ENV
17
+ # @return [String]
18
+ def api_key
19
+ ENV['TMDB_REXX_API_KEY'] || @api_key
20
+ end
27
21
 
28
- # Default API base_url from ENV or {API_BASE_URL}
29
- # @return [String]
30
- def base_url
31
- ENV['MOVIEREXX_BASE_URL'] || @base_url || BASE_URL
32
- end
22
+ # Default API base_url from ENV or {API_BASE_URL}
23
+ # @return [String]
24
+ def base_url
25
+ require "pry"
26
+ ENV['TMDB_REXX_BASE_URL'] || @base_url || BASE_URL
27
+ end
33
28
 
34
- # Default API version from ENV or {API_VERSION}
35
- # @return [String]
36
- def version
37
- ENV['MOVIEREXX_VERSION'] || @version || VERSION
38
- end
29
+ # Default API version from ENV or {API_VERSION}
30
+ # @return [String]
31
+ def version
32
+ ENV['TMDB_REXX_VERSION'] || @version || VERSION
33
+ end
39
34
 
40
- # Default include_adult from ENV or {INCLUDE_ADULT}
41
- # @return [String]
42
- def include_adult
43
- ENV['MOVIEREXX_INCLUDE_ADULT'] || @include_adult || INCLUDE_ADULT
44
- end
35
+ # Default include_adult from ENV or {INCLUDE_ADULT}
36
+ # @return [String]
37
+ def include_adult
38
+ ENV['TMDB_REXX_INCLUDE_ADULT'] || @include_adult || INCLUDE_ADULT
39
+ end
45
40
 
46
- # Default language from ENV or {LANGUAGE}
47
- # @return [String]
48
- def language
49
- ENV['MOVIEREXX_LANGUAGE'] || @language || LANGUAGE
50
- end
41
+ # Default language from ENV or {LANGUAGE}
42
+ # @return [String]
43
+ def language
44
+ ENV['TMDB_REXX_LANGUAGE'] || @language || LANGUAGE
51
45
  end
52
46
  end
53
47
  end
@@ -1,3 +1,3 @@
1
1
  module TmdbRexx
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmdb_rexx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Truluck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler