hash_to_struct 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +35 -0
- data/CHANGELOG.md +6 -0
- data/README.md +5 -2
- data/lib/hash_to_struct/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f7642ed6ecddc9da979178ce9dfe162970cfdcc6bf430ebfbec7f2ad0108b2f
|
4
|
+
data.tar.gz: b0686ee7f682f6a831875976c57d0165c240d1e5ab18c6e86e06c677d16116aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54d61baabf6d78fe28a0d8f542b20d91eb7714bb48e3c0c6059a77afa166a756c31a5cd53679b39cbbc32a1761fd1a16ffef5387185edf4f716b4e3e5a1eba1d
|
7
|
+
data.tar.gz: cce523b64be177c32cf8d456e0fbde93d35a0c8fe2241aca84aba5db346095120e65bada9df61d501f7c7edcbca55abcffc801ad30822ab23c86990deac0d715
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ main ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ main ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
+
uses: ruby/setup-ruby@v1
|
30
|
+
# uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# HashToStruct
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/hash_to_struct.svg)](https://badge.fury.io/rb/hash_to_struct)
|
4
|
+
[![Ruby](https://github.com/a-bohush/hash_to_struct/actions/workflows/ruby.yml/badge.svg?branch=main)](https://github.com/a-bohush/hash_to_struct/actions/workflows/ruby.yml)
|
5
|
+
|
6
|
+
It enables recursive conversion of a ruby `Hash` to a Struct-like object and back.
|
4
7
|
|
5
8
|
Stop thinking about symbols vs strings when accessing values in your hash. Simply call a method.
|
6
9
|
|
@@ -56,7 +59,7 @@ struct = HashToStruct.struct({q: 1, w: { e: 2 }})
|
|
56
59
|
|
57
60
|
struct.q.w.e # => 2
|
58
61
|
```
|
59
|
-
**Note!** It will only convert objects of type Hash, not Hash derivatives or some acting like Hash.
|
62
|
+
**Note!** It will only convert objects of type Hash, not Hash derivatives or some acting like a Hash.
|
60
63
|
|
61
64
|
Recursive conversions inside `Array`:
|
62
65
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_to_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bohush
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -62,6 +62,7 @@ extensions: []
|
|
62
62
|
extra_rdoc_files:
|
63
63
|
- README.md
|
64
64
|
files:
|
65
|
+
- ".github/workflows/ruby.yml"
|
65
66
|
- ".gitignore"
|
66
67
|
- ".rspec"
|
67
68
|
- CHANGELOG.md
|