Sha256: 661dafddda928d00a9543b80e7447ab1f06fbb238d9ded495ffa422ebdc29eaf
Contents?: true
Size: 828 Bytes
Versions: 2
Compression:
Stored size: 828 Bytes
Contents
# This class is used for testing the lazy_methods functionality. class LazyMethods::Tester include LazyMethods attr_reader :test_method_called define_lazy_methods :test_method, :to_s define_async_methods :test_method, :to_s define_lazy_class_methods :test_class_method, :to_s define_async_class_methods :test_class_method, :to_s def initialize @test_method_called = 0 @lazy_real_method_called = false end def test_method(arg) sleep(0.02) @test_method_called += 1 yield if block_given? arg.upcase if arg end class << self attr_accessor :test_class_method_called def test_class_method(arg) sleep(0.02) @test_class_method_called = (self.test_class_method_called || 0) + 1 yield if block_given? arg.upcase if arg end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lazy_methods-2.0.1 | spec/method_tester.rb |
lazy_methods-2.0.0 | spec/method_tester.rb |