LVS-JSONService 0.2.8 → 0.2.9
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.
- data/.specification +1 -1
- data/JSONService.gemspec +1 -1
- data/VERSION +1 -1
- data/lib/lvs/json_service/base.rb +10 -0
- data/spec/lvs/json_service/base_spec.rb +0 -10
- metadata +2 -3
data/.specification
CHANGED
data/JSONService.gemspec
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.9
|
@@ -154,8 +154,18 @@ module LVS
|
|
154
154
|
key.camelize(:lower)
|
155
155
|
end
|
156
156
|
|
157
|
+
def respond_to?(name)
|
158
|
+
name = name.to_s
|
159
|
+
key = name_to_key(name)
|
160
|
+
value = @data[key]
|
161
|
+
!value.nil?
|
162
|
+
end
|
163
|
+
|
157
164
|
def method_missing(name, *args)
|
158
165
|
name = name.to_s
|
166
|
+
if name == "respond_to?" # don't know why this hack is necessary, but it is at the moment...
|
167
|
+
return respond_to?(args[0])
|
168
|
+
end
|
159
169
|
key = name_to_key(name)
|
160
170
|
value = @data[key]
|
161
171
|
if name =~ /=$/
|
@@ -19,14 +19,4 @@ describe LVS::JsonService::Base do
|
|
19
19
|
lambda {obj.do_voodoo}.should raise_error(NoMethodError)
|
20
20
|
end
|
21
21
|
|
22
|
-
it "should find camelCase attributes using camelCase or ruby_sytax" do
|
23
|
-
class AttributeNames < LVS::JsonService::Base
|
24
|
-
self.ignore_missing = true
|
25
|
-
fake_service :call, '{"longMethodName":1}'
|
26
|
-
end
|
27
|
-
obj = AttributeNames.call
|
28
|
-
obj.longMethodName.should eql(1)
|
29
|
-
obj.long_method_name.should eql(1)
|
30
|
-
end
|
31
|
-
|
32
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LVS-JSONService
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LVS
|
@@ -44,7 +44,6 @@ files:
|
|
44
44
|
- spec/spec_helper.rb
|
45
45
|
has_rdoc: false
|
46
46
|
homepage: http://github.com/lvs/JSONService
|
47
|
-
licenses:
|
48
47
|
post_install_message:
|
49
48
|
rdoc_options:
|
50
49
|
- --charset=UTF-8
|
@@ -65,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements: []
|
66
65
|
|
67
66
|
rubyforge_project:
|
68
|
-
rubygems_version: 1.
|
67
|
+
rubygems_version: 1.2.0
|
69
68
|
signing_key:
|
70
69
|
specification_version: 3
|
71
70
|
summary: A Ruby library for interacting with external JSON services
|