yelp 2.0.1 → 2.0.2

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: 710d6c122e7ae066c91a091792306a3750d7b2ac
4
- data.tar.gz: 2d11f7b9635da6bc2bff6225f15f53e3f9104fbe
3
+ metadata.gz: 609114edae58cde77e52f43c0699f0e131ea119f
4
+ data.tar.gz: 4105ee754fd7dda2a67d571cfd5ddbba5188ee6f
5
5
  SHA512:
6
- metadata.gz: 34b6db5b4727c5352c0a94d24b190463b05e810c364863144955b6de97a8405fa4cf2c1021d0bb2f481112accb5302bc9a25a7f39250cd2aa5d97676bce8f9a8
7
- data.tar.gz: 3ca2121ebc48b5c19352654828e39ee66c032e4a9bc5d931147aeb722a163bafe6ca6780162a858d5573c32044f8ab6d642003f414ea1ec4ca858e2c8be585a3
6
+ metadata.gz: 94c94ace4a6bf10ebaea8a23bec901732b63f5440d1bd5a8d6a063e6f58a6a11403f0e8002b30b7ee19c706551ddaf7dff524680bd0ba2ecf35f5ffdf69f967f
7
+ data.tar.gz: 8372978d8ca9c4ea7b9709793675d70c97f740ce773ce09e7ca9b66e972611f2448c71a6e2aa8bcaf3bc9989e8bcefcc520ed59d4684c8f69e4bc7d6d1fba746
@@ -15,7 +15,7 @@ module BurstStruct
15
15
  end
16
16
 
17
17
  def respond_to?(method_name, include_private = false)
18
- @hash.keys.include?(method_name) || super
18
+ has_key?(method_name) || super
19
19
  end
20
20
 
21
21
  def self.convert_array(array)
@@ -35,6 +35,10 @@ module BurstStruct
35
35
  JSON.generate(@hash)
36
36
  end
37
37
 
38
+ def has_key?(method_name)
39
+ !find_key(method_name).nil?
40
+ end
41
+
38
42
  private
39
43
 
40
44
  def return_or_build_struct(method_name)
data/lib/yelp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yelp
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -8,12 +8,20 @@ describe BurstStruct::Burst do
8
8
  it 'should return' do
9
9
  expect(struct.foo).to eql 'bar'
10
10
  end
11
+
12
+ it { should have_key(:foo) }
13
+ it { should have_key('foo') }
14
+
15
+ it { should respond_to(:foo) }
11
16
  end
12
17
 
13
18
  context 'when a key does not exist' do
14
19
  it 'should not respond to it' do
15
20
  expect(struct.respond_to? :super_foo).to eql false
16
21
  end
22
+
23
+ it { should_not have_key(:super_foo) }
24
+ it { should_not have_key('super_foo') }
17
25
  end
18
26
  end
19
27
 
@@ -121,4 +129,19 @@ describe BurstStruct::Burst do
121
129
  expect(struct.to_json).to eql hash.to_json
122
130
  end
123
131
  end
132
+
133
+ context 'struct with string keys' do
134
+ subject(:struct) { BurstStruct::Burst.new('foo' => 'bar') }
135
+
136
+ context 'when a key exists' do
137
+ it 'should return' do
138
+ expect(struct.foo).to eql 'bar'
139
+ end
140
+
141
+ it { should have_key(:foo) }
142
+ it { should have_key('foo') }
143
+
144
+ it { should respond_to(:foo) }
145
+ end
146
+ end
124
147
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yelp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomer Elmalem
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-02 00:00:00.000000000 Z
13
+ date: 2014-08-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -271,4 +271,3 @@ test_files:
271
271
  - spec/yelp/endpoint/search_spec.rb
272
272
  - spec/yelp/error_spec.rb
273
273
  - spec/yelp/yelp_spec.rb
274
- has_rdoc: