Class: Helpstation::Observer

Inherits:
Object
  • Object
show all
Includes:
AbstractType
Defined in:
lib/helpstation/observer.rb

Direct Known Subclasses

ErrorObserver, SuccessObserver

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Observer

Returns a new instance of Observer.



15
16
17
18
19
20
21
# File 'lib/helpstation/observer.rb', line 15

def initialize(response)
  @response = response
  @env      = response.env
  @input    = response.input
  @output   = response.output
  @request  = response.request
end

Class Method Details

.call(response) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Perform the observer

Parameters:

  • the (Substation::Response)

    response returned when calling the action



11
12
13
# File 'lib/helpstation/observer.rb', line 11

def self.call(response)
  new(response).call
end