Sha256: 73811b04b741b72c70348afe4f11179f9d9290dc7c13618fb4e30c17182e1084
Contents?: true
Size: 428 Bytes
Versions: 3
Compression:
Stored size: 428 Bytes
Contents
class Configatron class Proc attr_accessor :execution_count attr_accessor :block def initialize(&block) self.execution_count = 0 self.block = block end def call unless @val val = self.block.call self.execution_count += 1 if finalize? @val = val end end return val || @val end def finalize? true end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
configatron-3.1.2 | lib/configatron/proc.rb |
configatron-3.1.1 | lib/configatron/proc.rb |
configatron-3.1.0 | lib/configatron/proc.rb |