Class: InternetScrabbleClub::Client::Middleware::Response::Transform

Inherits:
Object
  • Object
show all
Defined in:
lib/internet_scrabble_club/client/middleware/response/transform.rb

Instance Method Summary collapse

Constructor Details

#initialize(stack, response_transformer = ResponseTransformers::Base.new) ⇒ Transform

Returns a new instance of Transform.



9
10
11
# File 'lib/internet_scrabble_club/client/middleware/response/transform.rb', line 9

def initialize(stack, response_transformer = ResponseTransformers::Base.new)
  @stack, @response_transformer = stack, response_transformer
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
# File 'lib/internet_scrabble_club/client/middleware/response/transform.rb', line 13

def call(env)
  env[:response] = @response_transformer.apply(env[:response])
  @stack.call(env)
end