Class: Nite::Owl::OnlyIf

Inherits:
PredicateAction show all
Defined in:
lib/nite/owl/niteowl.rb

Instance Attribute Summary

Attributes inherited from Action

#parent

Instance Method Summary collapse

Methods inherited from PredicateAction

#call, #expired?, #expires

Methods inherited from Action

#add, #after, #also, #call, call_all_deferred_actions, #cancel, #changes, #contains?, #created, #current_action, #defer, #delay, #deleted, #handle_delay, #if_not, #ignore, #modified, #only_if, #only_once, #remove, #renamed, #root, #run, #undefer

Constructor Details

#initialize(block) ⇒ OnlyIf

Returns a new instance of OnlyIf.



378
379
380
381
# File 'lib/nite/owl/niteowl.rb', line 378

def initialize(block)
  super()
  @predicate = block
end

Instance Method Details

#predicate?(name, flags) ⇒ Boolean

Returns:

  • (Boolean)


382
383
384
# File 'lib/nite/owl/niteowl.rb', line 382

def predicate?(name,flags)
  @predicate.call(name,flags)
end