Class: Vigiles::Middleware::RecordConversation

Inherits:
Object
  • Object
show all
Defined in:
lib/vigiles/middleware/record_conversation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = Vigiles::Options.make_default_options) ⇒ RecordConversation

Returns a new instance of RecordConversation.



16
17
18
19
# File 'lib/vigiles/middleware/record_conversation.rb', line 16

def initialize(app, options = Vigiles::Options.make_default_options)
  @app     = app
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/vigiles/middleware/record_conversation.rb', line 8

def options
  @options
end

Instance Method Details

#call(env) ⇒ Object



22
23
24
25
26
27
# File 'lib/vigiles/middleware/record_conversation.rb', line 22

def call(env)
  req = ActionDispatch::Request.new(env)
  record_conversation(req) do
    @app.call(req.env)
  end
end