Class: LitleOnline::DefaultLitleListener

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

Overview

This listener will run the provided closure over every response hash This is the base class for all listeners applied to transaction responses

Instance Method Summary collapse

Constructor Details

#initialize(&action) ⇒ DefaultLitleListener

Returns a new instance of DefaultLitleListener.



35
36
37
# File 'lib/LitleListeners.rb', line 35

def initialize(&action)
  @action = action  
end

Instance Method Details

#apply(duck) ⇒ Object



39
40
41
42
# File 'lib/LitleListeners.rb', line 39

def apply(duck)
  # apply the proc uniformly across all response types
  @action.call(duck)
end