dynamini 1.2.3 → 1.2.5

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
  SHA1:
3
- metadata.gz: 7cbcee641ad1f4fdd6f752c6e31f1b324c5033ba
4
- data.tar.gz: 0599a51310b20c7f5a0f3e6533b997dda160c9cb
3
+ metadata.gz: 535dbed90e96eaf2511d6d898e04d576e564f331
4
+ data.tar.gz: 7405c0346eeba3c05225ab71e979b52fa8385f85
5
5
  SHA512:
6
- metadata.gz: f84030dbe0aa4c8575c91a2bd4018dbe9d0a0e672db19d0b758aecd2e6ef5dffff0eb3be1cd8c203d6bc4f8670767c50c737b991f9304089e8a0a9632c2ec7f3
7
- data.tar.gz: a3e9e41998bc821ec43b52b6f397fb1f0bde5b99f3577a7beedd3e3e8d3ca56b8d39b67a959704c0439d91404ff235af092a14569b00e5deb9b82978dd9cc19b
6
+ metadata.gz: eb36d1fcf64684de6f60ef5368213010a4ebd13665436ae056e5e45c6baf2f4fb118bd2120a8d1d1b9b120252c40a9d7f88d1deed23a42288295063618709f4b
7
+ data.tar.gz: 6be9c4892f80ac170221c562366cc93cecb52be66fe7741a93c0416813af07f287b0ad6838a50c1ffccbf3bc1d9718d12588de85bdeca1461da55148cbf604fd
data/lib/dynamini/base.rb CHANGED
@@ -104,7 +104,7 @@ module Dynamini
104
104
  end
105
105
 
106
106
  def ==(object)
107
- attributes == object.attributes
107
+ hash_key == object.hash_key if object.is_a?(self.class)
108
108
  end
109
109
 
110
110
  def assign_attributes(attributes)
@@ -22,7 +22,9 @@ module Dynamini
22
22
  end
23
23
 
24
24
  def get_item(args = {})
25
- attributes_hash = @data[args[:table_name]][args[:key][hash_key]]
25
+ table = args[:table_name]
26
+ @data[table] ||= {}
27
+ attributes_hash = @data[table ][args[:key][hash_key]]
26
28
  item = attributes_hash.nil? ? nil : attributes_hash
27
29
  OpenStruct.new(item: item)
28
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamini
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Ward