aws-sdk-dynamodb-attribute-deserializer 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +34 -0
- data/README.md +35 -0
- data/Rakefile +4 -0
- data/aws-sdk-dynamodb-attribute-deserializer.gemspec +30 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/aws-sdk-dynamodb-attribute-deserializer.rb +1 -0
- data/lib/aws/dynamodb/attribute_deserializer.rb +39 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dd1a922865e0a638e8cf4c682a8dd9738bade3f8173b4d3e750b83116cf3e9fb
|
4
|
+
data.tar.gz: c73c72546ba98aa0124f80cc41f8fcd9a821b6d3c6c467144aa3e4ef2255d015
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 77276857ff8f7914e2c4f1036711705fd9836fbc864bf2b6f98b8c24ca60ad294a24427d56ccf17c28c2e54ab91b5d5bd147f1da45714a3b6fad762df97a27c9
|
7
|
+
data.tar.gz: c12d8e795ce3e2976f3fbe4f9029884bda984e621bba1c835e3adf22f62981f16496bb6ea284a7c43a92b3eb8274b9e8446400d816e727f122ee0f10e7b5e78b
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
aws-sdk-dynamodb-attribute-deserializer (1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.4.4)
|
10
|
+
rake (13.0.3)
|
11
|
+
rspec (3.10.0)
|
12
|
+
rspec-core (~> 3.10.0)
|
13
|
+
rspec-expectations (~> 3.10.0)
|
14
|
+
rspec-mocks (~> 3.10.0)
|
15
|
+
rspec-core (3.10.1)
|
16
|
+
rspec-support (~> 3.10.0)
|
17
|
+
rspec-expectations (3.10.1)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.10.0)
|
20
|
+
rspec-mocks (3.10.1)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.10.0)
|
23
|
+
rspec-support (3.10.1)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
x86_64-darwin-20
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
aws-sdk-dynamodb-attribute-deserializer!
|
30
|
+
rake (~> 13.0)
|
31
|
+
rspec (~> 3.2)
|
32
|
+
|
33
|
+
BUNDLED WITH
|
34
|
+
2.2.3
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Aws::Sdk::Dynamodb::AttributeDeserializer
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/aws/sdk/dynamodb/attribute_deserializer`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'aws-sdk-dynamodb-attribute_deserializer'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install aws-sdk-dynamodb-attribute_deserializer
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/aws-sdk-dynamodb-attribute_deserializer.
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "aws-sdk-dynamodb-attribute-deserializer"
|
5
|
+
spec.version = '1.0'
|
6
|
+
spec.authors = ["Julien D."]
|
7
|
+
spec.email = ["julien@pocketsizesun.com"]
|
8
|
+
|
9
|
+
spec.summary = "AWS DynamoDB - Attribute Deserializer"
|
10
|
+
spec.description = "AWS DynamoDB -Attribute Deserializer"
|
11
|
+
spec.homepage = "https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.2"
|
30
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "aws/sdk/dynamodb/attribute_deserializer"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'aws/dynamodb/attribute_deserializer'
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module DynamoDB
|
5
|
+
class AttributeDeserializer
|
6
|
+
def self.call(hash)
|
7
|
+
new.call(hash)
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(hash)
|
11
|
+
return unless hash.is_a?(Hash)
|
12
|
+
|
13
|
+
hash.transform_values { |v| translate(v) }
|
14
|
+
end
|
15
|
+
|
16
|
+
def translate(arg)
|
17
|
+
type, value = arg.to_a.first
|
18
|
+
case type
|
19
|
+
when 'N' then value.to_s
|
20
|
+
when 'L'
|
21
|
+
value.map { |item| translate(item) }
|
22
|
+
when 'SS'
|
23
|
+
Set.new(value)
|
24
|
+
when 'NS'
|
25
|
+
Set.new(value.map(&:to_s))
|
26
|
+
when 'M'
|
27
|
+
value.transform_values { |item| translate(item) }
|
28
|
+
when 'S' then value.to_s
|
29
|
+
when 'B' then Base64.decode64(value)
|
30
|
+
when 'BS'
|
31
|
+
Set.new(value.map { |item| Base64.decode64(item) })
|
32
|
+
when 'NULL' then nil
|
33
|
+
when 'BOOL' then value
|
34
|
+
else value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aws-sdk-dynamodb-attribute-deserializer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Julien D.
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
|
+
description: AWS DynamoDB -Attribute Deserializer
|
28
|
+
email:
|
29
|
+
- julien@pocketsizesun.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
37
|
+
- README.md
|
38
|
+
- Rakefile
|
39
|
+
- aws-sdk-dynamodb-attribute-deserializer.gemspec
|
40
|
+
- bin/console
|
41
|
+
- bin/setup
|
42
|
+
- lib/aws-sdk-dynamodb-attribute-deserializer.rb
|
43
|
+
- lib/aws/dynamodb/attribute_deserializer.rb
|
44
|
+
homepage: https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby
|
45
|
+
licenses: []
|
46
|
+
metadata:
|
47
|
+
allowed_push_host: https://rubygems.org
|
48
|
+
homepage_uri: https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby
|
49
|
+
source_code_uri: https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby
|
50
|
+
changelog_uri: https://github.com/pocketsizesun/aws-sdk-dynamodb-attribute-deserializer-ruby
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 2.3.0
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubygems_version: 3.2.3
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: AWS DynamoDB - Attribute Deserializer
|
70
|
+
test_files: []
|