nstore 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9370bb243c554ce331b9c3cb4f04fe1f51efcdda5663e233789dd2623ae81d77
4
- data.tar.gz: a123c25104607d3dcba6ba6386b6a4fc7975201d57a0fcacae777e38f84eacd3
3
+ metadata.gz: 7f055519a1caca556d149d93bb445aa06af9cba0f757ec0ed267da67b5f70375
4
+ data.tar.gz: 3b337eca2aacbcb4ac42574afb64f6fe790d6894b046f207d31a8413a3ed99a2
5
5
  SHA512:
6
- metadata.gz: 86fec58f7f5704eaa211aa2ebcabf18642d5617ca0991e61b0b1abafef0b8b285c15b99af88916fcc60f36dc218429a1b8b6cd24165c4985a1440c8a2115b5c2
7
- data.tar.gz: 184f4a9b384f3c6ecac3880ac11f5457e66039e24fef677d06324961c8aa538313d824324dc94a73ca96d0c7ec7bf3e73230e945feb7a4a156afe677270f260c
6
+ metadata.gz: 0df430ee1905d9f34c3cf47612fc489c94a215252cb6f5d6712bb34038f3e780b93b584b6fab54afe8014b35d5eac1457876e244b6d3b211147199df80c37ea9
7
+ data.tar.gz: 45a7f9cc1fd4821e8516856ea105d1dffe147d15cf1a7f7ca6155489dd6aab316ac8989cc07faf3e5f1403d8947206f88ea63687263d0419fa48ce6b98cd678b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nstore (0.1.0)
4
+ nstore (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NStore
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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 = options.fetch(:prefix, false)
33
- stringify = options.fetch(:stringify, false)
34
- accessors = options[: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.1.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-16 00:00:00.000000000 Z
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.4
124
+ rubygems_version: 3.0.2
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: NStore - nested attributes accessors.