Class: Ick::Guard

Inherits:
Wrap show all
Includes:
Singleton
Defined in:
lib/ick/guard.rb

Direct Known Subclasses

Maybe, Please, Try

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Wrap

#invoke_wrapped, #unwrap, #wrap

Methods inherited from Base

belongs_to, #evaluate, evaluates_in_calling_environment, evaluates_in_value_environment, #returns, returns_result, returns_value, underscore

Class Method Details

.guardObject



28
29
30
# File 'lib/ick/guard.rb', line 28

def self.guard
  @guard_proc
end

.guard_with(&proc) ⇒ Object



24
25
26
# File 'lib/ick/guard.rb', line 24

def self.guard_with(&proc)
  @guard_proc = proc
end

Instance Method Details

#invoke(value, &proc) ⇒ Object



32
33
34
# File 'lib/ick/guard.rb', line 32

def invoke(value, &proc)
  invoke_wrapped(value, GuardWrapper, nil, self.class.guard, &proc)
end