class Mushin::Test::Sample::Ext

Public Class Methods

new(ext, opts = {}, params= {}) click to toggle source
# File lib/mushin/test_helper.rb, line 6
def initialize(ext, opts = {}, params= {})
  @ext                 = ext 
  @opts        = opts 
  @params      = params 
end

Public Instance Methods

call(env) click to toggle source
# File lib/mushin/test_helper.rb, line 12
def call(env)
  env ||= Hash.new #if env.nil?
  $log.info "-----------------------------------------------------------------------"
  $log.info "Ext: #{self} is called with the following options: #{@opts} & params: #{@params}; and env: #{env}"
  $log.info "-----------------------------------------------------------------------"

  # Inbound maniuplation

  env[:events] ||= []

  $log.info  env[:var] = "#{self} new_value_inbound"

  $log.info  env[:events] << "#{self} new_event_inbound"

  @ext.call(env)

  #Outbound maniuplation
  $log.info  env[:var] = "#{self} new_value_outbound"

  $log.info env[:events] << "#{self} new_event_outbound"
end