tmdb_rexx 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b386c7c20aad837f72bdc96f1b6856263cfb008
4
- data.tar.gz: 3c8fcaa672fd2d1252120b3a31d7bde0b812627c
3
+ metadata.gz: 619d2a6621720c0066a6426cbb3fba5c19a73d0c
4
+ data.tar.gz: 35c8cad72c301475fe237d2013e2395c319353dd
5
5
  SHA512:
6
- metadata.gz: b3358486bd25dfa29ebc5218c8aa18aefcbab67d3a7450a82857aa5980ec0b6c95ed03bc08ef4dc62aab76e1f551afbe0ebefc57d4303dbb0fb11d9fbe4b5d6e
7
- data.tar.gz: 4cb5d2ab5b8032c49936619cd32164a9542a9a41e6ca03b27cf3b5d0b94e32a63520d3c24aae07eccc585ed2e98ad941e74b8c32f66fb78c90c1c753e713df6d
6
+ metadata.gz: 2fd505943d45eeb297855ba0eaba3da0388198196302438ef22a383e7da90341c613148a7d13ad92b05bec7b032059edabef3d286a0702729f0ded8bdf4156da
7
+ data.tar.gz: ace8ae840d15b1df5d3c016b27fc792379d796c41e772945efaa0e538b42f58d103050f8894828d4c2419f1a05d5af3d6a1c07dc9008896ee2540aced36a7e35
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -0,0 +1,41 @@
1
+ module TmdbRexx
2
+ class Client
3
+ module Search
4
+ RESOURCE = "search".freeze
5
+ POSSIBLE_TYPES = %w(company collection keyword list movie multi person tv).freeze
6
+
7
+ # Search the tmdb database for the specified type
8
+ #
9
+ # @see http://docs.themoviedb.apiary.io/#reference/search
10
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchcompany
11
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchcollection
12
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchkeyword
13
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchlist
14
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchmovie
15
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchmulti
16
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchperson
17
+ # @see http://docs.themoviedb.apiary.io/#reference/search/searchtv
18
+ #
19
+ # @param [String] type the type of resource to search.
20
+ # Possible types include:
21
+ # * company - Search for companies by name.
22
+ # * collection - Search for collections by name.
23
+ # * keyword - Search for keywords by name.
24
+ # * list - Search for lists by name and description.
25
+ # * movie - Search for movies by title.
26
+ # * multi - Search the movie, tv show and person collections with a single query. Each item returned in the result array has a media_type field that maps to either movie, tv or person.Each mapped result is the same response you would get from each independent search.
27
+ # * person - Search for people by name.
28
+ # * tv - Search for TV shows by title.
29
+ #
30
+ # @return [Hashie::Mash] changes response
31
+ #
32
+ # @example Get the movie search api response
33
+ # TmdbRexx::Client.search("movie", "some-query")
34
+ def search(type, query, options = {})
35
+ raise InvalidTypeError unless POSSIBLE_TYPES.include?(type)
36
+ options.merge!(query: query)
37
+ get([RESOURCE, type].join("/"), options)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -19,6 +19,7 @@ require 'tmdb_rexx/client/network'
19
19
  require 'tmdb_rexx/client/review'
20
20
  require 'tmdb_rexx/client/timezone'
21
21
  require 'tmdb_rexx/client/person'
22
+ require 'tmdb_rexx/client/search'
22
23
 
23
24
  module TmdbRexx
24
25
  class Client
@@ -42,6 +43,7 @@ module TmdbRexx
42
43
  include TmdbRexx::Client::Review
43
44
  include TmdbRexx::Client::Timezone
44
45
  include TmdbRexx::Client::Person
46
+ include TmdbRexx::Client::Search
45
47
 
46
48
  def initialize(options = {})
47
49
  TmdbRexx::Configuration.keys.each do |key|
@@ -1,3 +1,3 @@
1
1
  module TmdbRexx
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmdb_rexx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Truluck
@@ -213,6 +213,7 @@ files:
213
213
  - lib/tmdb_rexx/client/network.rb
214
214
  - lib/tmdb_rexx/client/person.rb
215
215
  - lib/tmdb_rexx/client/review.rb
216
+ - lib/tmdb_rexx/client/search.rb
216
217
  - lib/tmdb_rexx/client/timezone.rb
217
218
  - lib/tmdb_rexx/configuration.rb
218
219
  - lib/tmdb_rexx/connection.rb