Class: Mushin::Test::Sample::Ext

Inherits:
Object
  • Object
show all
Defined in:
lib/mushin/test_helper.rb

Direct Known Subclasses

Store

Instance Method Summary collapse

Constructor Details

#initialize(ext, opts = {}, params = {}) ⇒ Ext

Returns a new instance of Ext.



6
7
8
9
10
# File 'lib/mushin/test_helper.rb', line 6

def initialize(ext, opts = {}, params= {})
  @ext 		= ext 
  @opts    	= opts 
  @params  	= params 
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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