Class: Nite::Owl::HasFlags

Inherits:
Action
  • Object
show all
Defined in:
lib/nite/owl/niteowl.rb

Instance Attribute Summary

Attributes inherited from Action

#parent

Instance Method Summary collapse

Methods inherited from Action

#add, #after, #also, 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(flags) ⇒ HasFlags

Returns a new instance of HasFlags.



398
399
400
401
# File 'lib/nite/owl/niteowl.rb', line 398

def initialize(flags)
  super()
  @flags = flags
end

Instance Method Details

#call(name, flags) ⇒ Object



405
406
407
# File 'lib/nite/owl/niteowl.rb', line 405

def call(name,flags)
  match?(flags) && super(name,flags)
end

#match?(flags) ⇒ Boolean

Returns:

  • (Boolean)


402
403
404
# File 'lib/nite/owl/niteowl.rb', line 402

def match?(flags)
  @flags.find { |f| flags.include?(f) }
end