Sha256: 63c775782930de8259cae77c0b3f618376ada4b40ed3c8878a1814739f534c43

Contents?: true

Size: 468 Bytes

Versions: 9

Compression:

Stored size: 468 Bytes

Contents

module MagicLamp
  module Callbacks
    attr_accessor :configuration

    def initialize(configuration)
      self.configuration = configuration
    end

    def execute_before_each_callback
      execute_callback(:before)
    end

    def execute_after_each_callback
      execute_callback(:after)
    end

    private

    def execute_callback(type)
      callback = configuration.send("#{type}_each_proc")
      callback.call unless callback.nil?
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
magic_lamp-1.5.0 lib/magic_lamp/callbacks.rb
magic_lamp-1.4.1 lib/magic_lamp/callbacks.rb
magic_lamp-1.4.0 lib/magic_lamp/callbacks.rb
magic_lamp-1.3.1 lib/magic_lamp/callbacks.rb
magic_lamp-1.3.0 lib/magic_lamp/callbacks.rb
magic_lamp-1.2.0 lib/magic_lamp/callbacks.rb
magic_lamp-1.1.1 lib/magic_lamp/callbacks.rb
magic_lamp-1.1.0 lib/magic_lamp/callbacks.rb
magic_lamp-1.0.0 lib/magic_lamp/callbacks.rb