hashlation 0.1.0 → 0.1.3
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 +4 -4
- data/.idea/.DS_Store +0 -0
- data/README.md +46 -8
- data/hashlation.gemspec +2 -2
- data/lib/hashlation/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f73fbcd96c1c7beeedd568b29102b4931a8d2425aaa9dada4fede99d1c0aa88
|
|
4
|
+
data.tar.gz: 8a7624e52ea1880b35e5df71d10d704fa8d25dd83205cac334faec748f4b4716
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 467cbaa9f2c43460c61266487f8f3aece0ef1af931a01f2bfe279608cbef2c38e3f6dfeabebfb93c4c9602509727135457e4eacfd5c097c7804f667ddf9ede8c
|
|
7
|
+
data.tar.gz: f95861a090051ccf724bc7cc10f7b43b45a15427847a7070487723c5cdac453545a0e83ac6a21a77f2d86111f77220a908dd63961da75c29364a26f4f398d29f
|
data/.idea/.DS_Store
CHANGED
|
Binary file
|
data/README.md
CHANGED
|
@@ -16,17 +16,51 @@ Or install it yourself as:
|
|
|
16
16
|
|
|
17
17
|
$ gem install hashlation
|
|
18
18
|
|
|
19
|
-
## Usage
|
|
20
19
|
|
|
21
|
-
Hashlation::Simple -> Hashlation::Simple.new(hash)
|
|
22
20
|
|
|
23
|
-
Handles simple string/symbol keys in conversion as well as singleton_methods. Much faster, but cannot hanlde edge cases in response.
|
|
24
|
-
|
|
25
|
-
Hashlation::Complex -> Hashlation::Complex.new(hash)
|
|
26
|
-
|
|
27
|
-
Handles MOST key types in conversion. If you know that your keys will contain leading Integer characters, or ':'.
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
## Methods
|
|
23
|
+
|
|
24
|
+
The returned `obj` includes the method `.keys` to list the keys on the object at every level.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### Simple
|
|
29
|
+
|
|
30
|
+
Handles simple string/symbol keys in conversion as well as singleton_methods. Very fast, but cannot handle edge cases in keys.
|
|
31
|
+
|
|
32
|
+
Usage:
|
|
33
|
+
|
|
34
|
+
`obj = Hashlation::Simple.new(hash)`
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### Complex
|
|
40
|
+
|
|
41
|
+
Handles MOST key types in conversion. If you know that your keys will contain leading Integer characters, or ':' use this method.
|
|
42
|
+
|
|
43
|
+
Usage:
|
|
44
|
+
|
|
45
|
+
`obj = Hashlation::Complex.new(hash)`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
** If `Complex` fails due to inability to read a key, please report in GitHub Issues. Thanks! **
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Translated Keys Format:
|
|
54
|
+
|
|
55
|
+
Keys that cannot be set as-is by attr_accessor will be transformed.
|
|
56
|
+
|
|
57
|
+
### Simple:
|
|
58
|
+
|
|
59
|
+
- `'Test-Name' -> obj.test_name`
|
|
60
|
+
|
|
61
|
+
### Complex:
|
|
62
|
+
|
|
63
|
+
- `'11123:12312' -> obj._11123_12312`
|
|
30
64
|
|
|
31
65
|
## Development
|
|
32
66
|
|
|
@@ -41,3 +75,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/rharri
|
|
|
41
75
|
## License
|
|
42
76
|
|
|
43
77
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
*Naming credit belongs to my wife, who bales out my inability to name stuff..*
|
data/hashlation.gemspec
CHANGED
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = ["rharris389"]
|
|
9
9
|
spec.email = ["56176404+rharris389@users.noreply.github.com"]
|
|
10
10
|
|
|
11
|
-
spec.summary = "
|
|
12
|
-
spec.description = "
|
|
11
|
+
spec.summary = "Lightweight response parsing"
|
|
12
|
+
spec.description = "Lightweight hash parser for cleaner navigation of large response objects."
|
|
13
13
|
spec.homepage = "https://github.com/rharris389/hashlation"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
data/lib/hashlation/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hashlation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rharris389
|
|
@@ -10,7 +10,7 @@ bindir: exe
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2022-05-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
13
|
+
description: Lightweight hash parser for cleaner navigation of large response objects.
|
|
14
14
|
email:
|
|
15
15
|
- 56176404+rharris389@users.noreply.github.com
|
|
16
16
|
executables: []
|
|
@@ -69,5 +69,5 @@ requirements: []
|
|
|
69
69
|
rubygems_version: 3.1.2
|
|
70
70
|
signing_key:
|
|
71
71
|
specification_version: 4
|
|
72
|
-
summary:
|
|
72
|
+
summary: Lightweight response parsing
|
|
73
73
|
test_files: []
|