Method: Pakyow::Support::Pipeline#initialize_copy

Defined in:
lib/pakyow/support/pipeline.rb

#initialize_copy(_) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/pakyow/support/pipeline.rb', line 101

def initialize_copy(_)
  super

  @__pipeline = @__pipeline.dup

  # rebind any methods to the new instance
  @__pipeline.instance_variable_get(:@stack).map! { |action|
    if action.is_a?(::Method) && action.receiver.is_a?(self.class)
      action.unbind.bind(self)
    else
      action
    end
  }
end