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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62bb6e258bb5205766ccb941ac9d91137698295b
4
- data.tar.gz: 03b575568253ace39829ebc50f18098ff81cd876
3
+ metadata.gz: 5ab13fc688f385555e5943cf24d9409431156756
4
+ data.tar.gz: 7e53cf0aa675478c43790c56c7234f93e7e8cce9
5
5
  SHA512:
6
- metadata.gz: e0ab3602c4603c6139d2a588775cd6edc7004ef2208064480933f509e4dde26f6962aac643bbb9f584e40402faa40111699d568689b67ca1882da7d8d6a5858e
7
- data.tar.gz: fe2ced8a302a4574e0ff4397915d2fae8fcaea7852d2abf096af825015b8d79ffeb0902b9048b6c3e9ef3d5b17e57d2f92a75a6027a940f3c1f7cf19f7272cb8
6
+ metadata.gz: 5550804cdcb6699423742b389ac129d6c4e12006f639f94c721afebc7e62bce3893dfbc5972b23ae3c2d9888d2d5d60a00b4f89033acdd4d37ebf75dbed49665
7
+ data.tar.gz: 58e4a89affad3c803551a367d62aef3505083e493d0c1d3deb44e667878825d8ce168a1f4b3efc7675d25d1dc63f94a8bb14150852cda270ece202c370cbcdae
@@ -3,3 +3,6 @@ Metrics:
3
3
 
4
4
  Style/Documentation:
5
5
  Enabled: false
6
+
7
+ Lint/Void:
8
+ Enabled: false
data/README.md CHANGED
@@ -83,9 +83,9 @@ An `Omdb::Api::Movie` object has
83
83
  #country
84
84
  #director
85
85
  #genre
86
- #imdbid
87
- #imdbrating
88
- #imdbvotes
86
+ #imdb_id
87
+ #imdb_rating
88
+ #imdb_votes
89
89
  #language
90
90
  #metascore
91
91
  #plot
@@ -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
- include KlassParam
6
+ attr_reader :response
7
+ :error
9
8
 
10
- param :response
11
- param :error
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
@@ -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
- include KlassParam
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
- param :actors
11
- param :awards
12
- param :country
13
- param :director
14
- param :genre
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
@@ -11,9 +11,9 @@ module Omdb
11
11
  movie = __format_data(data)
12
12
 
13
13
  if request.success?
14
- Omdb::Api::Movie.new(params: movie)
14
+ Omdb::Api::Movie.new(movie)
15
15
  else
16
- Omdb::Api::Error.new(params: movie)
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(params: movie)
29
+ Omdb::Api::Movie.new(movie)
30
30
  end
31
31
  )
32
32
  else
33
- Omdb::Api::Error.new(params: request.response)
33
+ Omdb::Api::Error.new(request.response)
34
34
  end
35
35
  end
36
36
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omdb
4
4
  module Api
5
- VERSION = '1.2.0'.freeze
5
+ VERSION = '1.3.0'.freeze
6
6
  end
7
7
  end
@@ -20,6 +20,5 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
  spec.add_dependency 'activesupport'
22
22
  spec.add_dependency 'httparty'
23
- spec.add_dependency 'klass_param'
24
23
  spec.add_development_dependency 'bundler'
25
24
  end
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.2.0
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