omdb-api 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/README.md +3 -3
- data/lib/omdb/api/error.rb +7 -5
- data/lib/omdb/api/movie.rb +25 -23
- data/lib/omdb/api/public_api.rb +4 -4
- data/lib/omdb/api/version.rb +1 -1
- data/omdb-api.gemspec +0 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ab13fc688f385555e5943cf24d9409431156756
|
4
|
+
data.tar.gz: 7e53cf0aa675478c43790c56c7234f93e7e8cce9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5550804cdcb6699423742b389ac129d6c4e12006f639f94c721afebc7e62bce3893dfbc5972b23ae3c2d9888d2d5d60a00b4f89033acdd4d37ebf75dbed49665
|
7
|
+
data.tar.gz: 58e4a89affad3c803551a367d62aef3505083e493d0c1d3deb44e667878825d8ce168a1f4b3efc7675d25d1dc63f94a8bb14150852cda270ece202c370cbcdae
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
data/lib/omdb/api/error.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'klass_param'
|
4
|
-
|
5
3
|
module Omdb
|
6
4
|
module Api
|
7
5
|
class Error
|
8
|
-
|
6
|
+
attr_reader :response
|
7
|
+
:error
|
9
8
|
|
10
|
-
|
11
|
-
|
9
|
+
def initialize(params)
|
10
|
+
params.each_pair do |k, v|
|
11
|
+
instance_variable_set("@#{k}", v)
|
12
|
+
end
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
data/lib/omdb/api/movie.rb
CHANGED
@@ -1,32 +1,34 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'klass_param'
|
4
|
-
|
5
3
|
module Omdb
|
6
4
|
module Api
|
7
5
|
class Movie
|
8
|
-
|
6
|
+
attr_reader :actors
|
7
|
+
:awards
|
8
|
+
:country
|
9
|
+
:director
|
10
|
+
:genre
|
11
|
+
:imdb_id
|
12
|
+
:imdb_rating
|
13
|
+
:imdb_votes
|
14
|
+
:language
|
15
|
+
:metascore
|
16
|
+
:plot
|
17
|
+
:poster
|
18
|
+
:rated
|
19
|
+
:released
|
20
|
+
:runtime
|
21
|
+
:title
|
22
|
+
:type
|
23
|
+
:writer
|
24
|
+
:year
|
25
|
+
:error
|
9
26
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
param :imdb_id
|
16
|
-
param :imdb_rating
|
17
|
-
param :imdb_votes
|
18
|
-
param :language
|
19
|
-
param :metascore
|
20
|
-
param :plot
|
21
|
-
param :poster
|
22
|
-
param :rated
|
23
|
-
param :released
|
24
|
-
param :runtime
|
25
|
-
param :title
|
26
|
-
param :type
|
27
|
-
param :writer
|
28
|
-
param :year
|
29
|
-
param :error
|
27
|
+
def initialize(params)
|
28
|
+
params.each_pair do |k, v|
|
29
|
+
instance_variable_set("@#{k}", v)
|
30
|
+
end
|
31
|
+
end
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
data/lib/omdb/api/public_api.rb
CHANGED
@@ -11,9 +11,9 @@ module Omdb
|
|
11
11
|
movie = __format_data(data)
|
12
12
|
|
13
13
|
if request.success?
|
14
|
-
Omdb::Api::Movie.new(
|
14
|
+
Omdb::Api::Movie.new(movie)
|
15
15
|
else
|
16
|
-
Omdb::Api::Error.new(
|
16
|
+
Omdb::Api::Error.new(movie)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -26,11 +26,11 @@ module Omdb
|
|
26
26
|
request.response.fetch('Search').map do |movie|
|
27
27
|
movie = __format_data(movie)
|
28
28
|
|
29
|
-
Omdb::Api::Movie.new(
|
29
|
+
Omdb::Api::Movie.new(movie)
|
30
30
|
end
|
31
31
|
)
|
32
32
|
else
|
33
|
-
Omdb::Api::Error.new(
|
33
|
+
Omdb::Api::Error.new(request.response)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
data/lib/omdb/api/version.rb
CHANGED
data/omdb-api.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omdb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Palaniuk
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: klass_param
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: bundler
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|