nstore 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nstore/version.rb +1 -1
- data/lib/nstore.rb +5 -3
- 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: 7f055519a1caca556d149d93bb445aa06af9cba0f757ec0ed267da67b5f70375
|
4
|
+
data.tar.gz: 3b337eca2aacbcb4ac42574afb64f6fe790d6894b046f207d31a8413a3ed99a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df430ee1905d9f34c3cf47612fc489c94a215252cb6f5d6712bb34038f3e780b93b584b6fab54afe8014b35d5eac1457876e244b6d3b211147199df80c37ea9
|
7
|
+
data.tar.gz: 45a7f9cc1fd4821e8516856ea105d1dffe147d15cf1a7f7ca6155489dd6aab316ac8989cc07faf3e5f1403d8947206f88ea63687263d0419fa48ce6b98cd678b
|
data/Gemfile.lock
CHANGED
data/lib/nstore/version.rb
CHANGED
data/lib/nstore.rb
CHANGED
@@ -29,9 +29,9 @@ module NStore
|
|
29
29
|
# List of Class methods going to be included above
|
30
30
|
module ClassMethods
|
31
31
|
def nstore(attribute, options)
|
32
|
-
prefix
|
33
|
-
stringify
|
34
|
-
accessors
|
32
|
+
prefix = options.fetch(:prefix, false)
|
33
|
+
stringify = options.fetch(:stringify, false)
|
34
|
+
accessors = options[:accessors]
|
35
35
|
|
36
36
|
flat_accessors = []
|
37
37
|
deep_flatten(accessors, [], flat_accessors)
|
@@ -84,7 +84,9 @@ module NStore
|
|
84
84
|
# @param [Array] keys
|
85
85
|
# @param [Object] value
|
86
86
|
def write_nstore_attribute(attribute, keys, value)
|
87
|
+
send("#{attribute}=", {}) if send(attribute).nil?
|
87
88
|
position = send(attribute)
|
89
|
+
|
88
90
|
keys[0..-2].each do |key|
|
89
91
|
position[key] = {} unless position[key].is_a?(Hash)
|
90
92
|
position = position[key]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renat "MpaK" Ibragimov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.0.
|
124
|
+
rubygems_version: 3.0.2
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: NStore - nested attributes accessors.
|