Class: Navy::Captain::Speak

Inherits:
Speak
  • Object
show all
Defined in:
lib/navy/captain/speak.rb

Instance Attribute Summary

Attributes inherited from Speak

#orders

Instance Method Summary collapse

Methods inherited from Speak

#after_fork, #after_stop, #before_fork, #before_stop, #curse!, #heartbeat, #initialize, #logger, #patience, #pid, #post_fork, #preload, #respawn_limit, #stderr_path, #stdout_path, #timeout, #user, #working_directory

Constructor Details

This class inherits a constructor from Navy::Speak

Instance Method Details

#officers(officer_count = 1, *args, &block) ⇒ Object



3
4
5
6
7
8
# File 'lib/navy/captain/speak.rb', line 3

def officers(officer_count = 1, *args, &block)
  options = args.last.is_a?(Hash) ? args.last : {}
  orders.set[:officer_count] = officer_count
  orders.set[:officer_job]   = block_given? ? block : args[0]
  orders.set[:officer_fire_and_forget] = options[:fire_and_forget] if options.has_key?(:fire_and_forget)
end