lazy_lazer 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02623a4fd292219e52a37ab7ff9403f19a04341f
4
- data.tar.gz: '0609a64cf39456530d98a0d317055256cf004317'
3
+ metadata.gz: 77feb46739d312dbc726ab9291c19b7d1d585a44
4
+ data.tar.gz: a9a5ffda84ee0ed882b7944d7a7767e59d8efeb9
5
5
  SHA512:
6
- metadata.gz: 315a2b347aca6b3c668f167cd086ede566861f9c1c5a5ebf6dad5ddf3d41fb7409007af3e8f812d7f75aa94487d35940bef90a076d589d0c3bcf4bddfe0fc3b0
7
- data.tar.gz: 12020aba963d98ab204e3809a60327d7d447adf014a4bfada76aa3ff04745ddd1db3be95bee301ba6339a120d6088d9bb1aaa56cb880e4c1ef88a9d18270c17f
6
+ metadata.gz: 8c4ec41ef8145e740c889200494831016cbb543f3fe1231bc93105a477bedcb765c242abc78f3307fabf8e791692da9a071b1dd991056c552c84ea2a216bffbf
7
+ data.tar.gz: e067e5cd6cde812fd9731b02ba4a4e5ee98a6a3bd630ae2241ef5d1f35f4d933ab526143b5acb77801deae4e5e5ae16067b9f7f062e12f41e875d3f56085e8ec
data/lib/lazy_lazer.rb CHANGED
@@ -82,7 +82,7 @@ module LazyLazer
82
82
  return false if self.class != other.class
83
83
  return super if @_lazer_model.required_properties.empty?
84
84
  @_lazer_model.required_properties.each do |key_name|
85
- return false if self[key_name] != other[key_name]
85
+ return false if read_attribute(key_name) != other.read_attribute(key_name)
86
86
  end
87
87
  true
88
88
  end
@@ -18,6 +18,7 @@ module LazyLazer
18
18
  # Converts all unconverted keys and packages them as a hash.
19
19
  # @return [Hash] the converted hash
20
20
  def to_h
21
+ return @cache_hash if fully_loaded?
21
22
  todo = @key_metadata.keys - @cache_hash.keys
22
23
  todo.each_with_object(@cache_hash) { |key, cache| cache[key] = load_key_from_source(key) }.dup
23
24
  end
@@ -32,8 +33,8 @@ module LazyLazer
32
33
  # @param key_name [Symbol] the key to check
33
34
  # @return [Boolean] whether the key exists locally.
34
35
  def exists_locally?(key_name)
35
- ensure_metadata_exists(key_name)
36
- @source_hash.key?(@key_metadata.get(key_name).source_key)
36
+ meta = ensure_metadata_exists(key_name)
37
+ @source_hash.key?(meta.source_key)
37
38
  end
38
39
 
39
40
  # Mark a key as tainted, forcing a reload on the next lookup.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LazyLazer
4
4
  # The gem's semantic version number.
5
- VERSION = '0.7.1'
5
+ VERSION = '0.7.2'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy_lazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avinash Dwarapu