api_client 0.5.6 → 0.5.7
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/api_client/base.rb +8 -6
- data/lib/api_client/version.rb +1 -1
- data/spec/api_client/base_spec.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afef879f60d75b581ba06820fe2a817926984909
|
4
|
+
data.tar.gz: 3fc80dfc8684c9a7002cb5ef90f309621951c652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 572c68cf1e8c7da1d39afc7c15bce81b72a17f0f9046140492e327aa673f68bee195072d0a335dd3822981bb37dcc7ced9adc8e43fb9de04eb0c6b7b5a2ec3bf
|
7
|
+
data.tar.gz: 77c85f3c1f0c1da5644e61dd1b452caca2335a1ce5bc7093c5d03de7ffc5ca6b2a274f98e2f3c0a5232d3f737d1370bad3b166472dd95e00189f2b40211fc1b5
|
data/CHANGELOG.md
CHANGED
data/lib/api_client/base.rb
CHANGED
@@ -58,15 +58,17 @@ module ApiClient
|
|
58
58
|
|
59
59
|
private
|
60
60
|
def method_missing(method_name, *args, &blk)
|
61
|
-
if respond_to?(method_name)
|
61
|
+
if respond_to?(method_name) || has_special_ending?(method_name)
|
62
62
|
super
|
63
|
+
elsif respond_to?(:strict_attr_reader?) && self.strict_attr_reader?
|
64
|
+
fetch(method_name)
|
63
65
|
else
|
64
|
-
|
65
|
-
fetch(method_name)
|
66
|
-
else
|
67
|
-
super
|
68
|
-
end
|
66
|
+
super
|
69
67
|
end
|
70
68
|
end
|
69
|
+
|
70
|
+
def has_special_ending?(name)
|
71
|
+
name.to_s =~ /[?=]$/
|
72
|
+
end
|
71
73
|
end
|
72
74
|
end
|
data/lib/api_client/version.rb
CHANGED
@@ -60,10 +60,16 @@ describe ApiClient::Base do
|
|
60
60
|
|
61
61
|
it "doesn't fail if the key was set after object was created" do
|
62
62
|
api = StrictApi.new
|
63
|
-
api.not_missing = 1
|
63
|
+
lambda { api.not_missing = 1 }.should_not raise_error
|
64
64
|
api.not_missing.should == 1
|
65
65
|
end
|
66
66
|
|
67
|
+
it "doesn't fail for predicate methods if key is not set" do
|
68
|
+
api = StrictApi.new
|
69
|
+
lambda { api.missing? }.should_not raise_error
|
70
|
+
api.missing?.should be_false
|
71
|
+
end
|
72
|
+
|
67
73
|
it "allows to call methods" do
|
68
74
|
api = StrictApi.new(:x => 14)
|
69
75
|
api.accessor_of_x.should == 14
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Bunsch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yajl-ruby
|