simple-lazy 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df4524bc007b8fb0e402772f18c91b4d9fe8c531966f28cdfbe72691d3bb9dbd
4
- data.tar.gz: 25dfcdb630ecebe6fbffabab38b2584d175f080cdd238a15ea3f0e91705892df
3
+ metadata.gz: 53c48791475aee5999bdb60f0739cf2f2741a5ab60584086aff63f0b42754a26
4
+ data.tar.gz: e5f766ae15390978a13194be2d61a1f2da2824c91a0db60b87e237706d3fa6af
5
5
  SHA512:
6
- metadata.gz: fdfd870a9c0b4f32cef7cd05c04b47fa59d421af13a5ee4290babc20bf2e0b40d79c3b25237e246424e9472e210b1df38e62ff02c275013f8d4b9ba813200cc5
7
- data.tar.gz: 06d8fa911efce4425f50f339d38fbb2b7bd9d9adc46b0c4da9fbd9ff6019e8704ff82d05d789e00e5b023bd7917b958af4789bc8269cca31d068779998772cfb
6
+ metadata.gz: 14e54048bda40b9642143b3dbcaa22752e933aa78aa1ada6db6e281054317249f2e7ec0660ccfd296df623af410c83b7bc9cfe3d482aae9e1a45057c17218b39
7
+ data.tar.gz: c73ffd108b7a4455764f35f9c574faecf5da8f870b413cec29beb2115f3c3d4cea3cb522cba6eae25462eb925809627ab44ffa8403ef196c278ca210608bfa3e
data/lib/simple/lazy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Simple
2
2
  class Lazy
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
 
5
5
  attr_reader :value
6
6
 
@@ -27,6 +27,14 @@ module Simple
27
27
  cached.public_send(method, *args, &block)
28
28
  end
29
29
 
30
+ def respond_to_missing?(method, include_private = false)
31
+ cached.respond_to?(method) || super
32
+ end
33
+
34
+ def methods
35
+ methods + cached.methods
36
+ end
37
+
30
38
  def cached
31
39
  unless @is_cached
32
40
  @cached = @block.call(value)
@@ -45,4 +45,10 @@ class TestSimpleLazy < Minitest::Test
45
45
  assert_equal("", lazy.to_s)
46
46
  assert_equal(true, lazy.cached?)
47
47
  end
48
+
49
+ def test_6
50
+ lazy = Simple::Lazy.new(1) { 2 }
51
+ assert_equal(true, lazy.respond_to?(:to_i))
52
+ assert_equal(false, lazy.respond_to?(:to_something_else))
53
+ end
48
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-lazy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - localhostdotdev