Module: CommandServiceObject::Hooks

Included in:
CaseBase
Defined in:
lib/command_service_object/hooks.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/command_service_object/hooks.rb', line 3

def self.included(base)
  base.send :extend, ClassMethods
  base.send :include, InstanceMethods

  class << base
    alias_method :_new, :new

    define_method :new do |command|
      _new(command).tap do |instance|
        instance.send(:setup_micros, _micros)
      end
    end
  end
end