lhs 5.6.6 → 5.7.0

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: 69913ab2a3b45766bc83f1c9bbe146dc8222ad3b
4
- data.tar.gz: 12aca78a7334087c9c93fc42b338eb58de74c57b
3
+ metadata.gz: d254b18e7c8820a918573b52e0e63156c752d174
4
+ data.tar.gz: 0fc88aedee1ad5ed13c45fcc6d728159f6181594
5
5
  SHA512:
6
- metadata.gz: 829eb8c9a105d0aef36ebcb63878c038db3bbe8aa2fb7444aacdd0b534ddb0496c5e3f2464ea86977be03b1b6ad8c312c62b51cf54826b49fd8795b372f1ec2d
7
- data.tar.gz: 0bb344b8a4ad023a8aa2deb125cde83bf381f340b3bcbd1bff68855fba7d86b151061a9fcf2887d9725369fa2515111a1715a3c77c2db9af389a3282321278f9
6
+ metadata.gz: 482482df0da72c5e52525848d9fc0f7a820e7e0a27973b0d5eaa0d2423aa8a2052eed27fbff857c38b89741316e96604abd3f76f8069c37e7ab519f79d5483eb
7
+ data.tar.gz: 8b3171364a64e320bcc05e9ed0cb2f34e1e7dfebb8f31f6de4daf7d765c66018b0b92f1b6b228265dbb7baf928ded6f9124d95c0fb1f36030f503fb15d46707a
@@ -27,6 +27,7 @@ class LHS::Item < LHS::Proxy
27
27
  name = args.first if name == :[]
28
28
  value = _data._raw[name.to_s]
29
29
  value = _data._raw[name.to_sym] if value.nil?
30
+ value = _data._raw[name.to_s.classify.to_sym] if value.nil?
30
31
  if value.is_a?(Hash)
31
32
  handle_hash(value)
32
33
  elsif value.is_a?(Array)
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "5.6.6"
2
+ VERSION = "5.7.0"
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'rails_helper'
2
+
3
+ describe LHS::Item do
4
+ context 'accessors' do
5
+ before(:each) do
6
+ class Record < LHS::Record
7
+ endpoint 'http://datastore/records'
8
+ end
9
+ end
10
+
11
+ it 'accesses camel case keys using underscore syntax' do
12
+ stub_request(:get, "http://datastore/records?id=1")
13
+ .to_return(body: { 'AttributeValue' => 42 }.to_json)
14
+
15
+ record = Record.find(1)
16
+ expect(record.attribute_value).not_to be nil
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhs
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.6
4
+ version: 5.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhs/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-06 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc
@@ -268,6 +268,7 @@ files:
268
268
  - spec/dummy/public/500.html
269
269
  - spec/dummy/public/favicon.ico
270
270
  - spec/endpoint/for_url_spec.rb
271
+ - spec/item/accessors_spec.rb
271
272
  - spec/item/delegate_spec.rb
272
273
  - spec/item/destroy_spec.rb
273
274
  - spec/item/errors_spec.rb
@@ -408,6 +409,7 @@ test_files:
408
409
  - spec/dummy/public/500.html
409
410
  - spec/dummy/public/favicon.ico
410
411
  - spec/endpoint/for_url_spec.rb
412
+ - spec/item/accessors_spec.rb
411
413
  - spec/item/delegate_spec.rb
412
414
  - spec/item/destroy_spec.rb
413
415
  - spec/item/errors_spec.rb