metahash-rb 1.0.1 → 1.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 +4 -4
- data/README.md +3 -0
- data/lib/metahash.rb +2 -2
- data/lib/metahash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dd0495140177117ee39d5dfab630bd2b2883b81
|
4
|
+
data.tar.gz: cece44198668cd884390321748306ca80b9e4764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19fdb4d1e1ca9ee1a2201bf8ca810f34268217ce5502053aa14958225299911c16855296b5641fdd96025b41e880d624044c223dd584c4c381f7e6e51dd5267a
|
7
|
+
data.tar.gz: 68bd91fbb923d0af5d4374cefab6b046b6db2d0e2168d3ef4fe9c8e6c3694061c56fd2655652926e10d74d6fd29972e4be174a67eea74566d1d6735c754ddec7
|
data/README.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
MetaHash
|
2
2
|
========
|
3
3
|
|
4
|
+
[](http://badge.fury.io/rb/metahash-rb)
|
4
5
|
[](https://ci.solanolabs.com:443/TinderBox/MetaHash/suites/110842)
|
5
6
|
[](https://codeclimate.com/github/NullVoxPopuli/MetaHash)
|
6
7
|
[](https://gemnasium.com/NullVoxPopuli/MetaHash)
|
8
|
+
[](https://codeclimate.com/github/NullVoxPopuli/MetaHash)
|
9
|
+
|
7
10
|
|
8
11
|
|
9
12
|
Provides a subclass of Hash and a wrapper around Rails' serialize attribute for object-like access to hashes without validating existence of nested hashes
|
data/lib/metahash.rb
CHANGED
@@ -9,10 +9,10 @@ module MetaHash
|
|
9
9
|
# the hash by creating class Metadata < Hash; end
|
10
10
|
#
|
11
11
|
# @param [Symbol] serialized_field name of the field to convert to Metadata
|
12
|
-
def has_metadata(serialized_field = "metadata")
|
12
|
+
def has_metadata(serialized_field = "metadata", serializer: JSON)
|
13
13
|
# tell Active Record that the field is going to be JSON
|
14
14
|
# serialized, because JSON > YAML
|
15
|
-
serialize serialized_field,
|
15
|
+
serialize serialized_field, serializer
|
16
16
|
|
17
17
|
after_initialize do |record|
|
18
18
|
# first check the type of the field
|
data/lib/metahash/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metahash-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L. Preston Sego III
|
@@ -141,7 +141,7 @@ rubyforge_project:
|
|
141
141
|
rubygems_version: 2.4.1
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
|
-
summary: MetaHash-1.0.
|
144
|
+
summary: MetaHash-1.0.2
|
145
145
|
test_files:
|
146
146
|
- spec/metadata_spec.rb
|
147
147
|
- spec/metahash_spec.rb
|