Class: Glimmer::ProcTracker

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

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ ProcTracker

Returns a new instance of ProcTracker.



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

def initialize(proc)
  super(proc)
end

Instance Method Details

#call(*args) ⇒ Object



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

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

#called?Boolean

Returns:

  • (Boolean)


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

def called?
  !!@called
end