Class: Glimmer::Util::ProcTracker

Inherits:
Proc
  • Object
show all
Defined in:
lib/glimmer/util/proc_tracker.rb

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ ProcTracker

Returns a new instance of ProcTracker.



27
28
29
# File 'lib/glimmer/util/proc_tracker.rb', line 27

def initialize(proc)
  super(proc)
end

Instance Method Details

#call(*args) ⇒ Object



30
31
32
33
# File 'lib/glimmer/util/proc_tracker.rb', line 30

def call(*args)
  __getobj__.call(*args)
  @called = true
end

#called?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/glimmer/util/proc_tracker.rb', line 34

def called?
  !!@called
end