Class: Nite::Owl::After

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(delay) ⇒ After

Returns a new instance of After.



367
368
369
370
371
# File 'lib/nite/owl/niteowl.rb', line 367

def initialize(delay)
  super()
  @delay = delay.to_f
  @time = nil
end

Instance Method Details

#predicate?(name, flags) ⇒ Boolean

Returns:

  • (Boolean)


372
373
374
# File 'lib/nite/owl/niteowl.rb', line 372

def predicate?(name,flags)
  Time.now.to_f >= @time+@delay
end