Class: IRWebmachine::Application

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Application

Returns a new instance of Application.



2
3
4
5
6
# File 'lib/irwebmachine/application.rb', line 2

def initialize(app)
  @app = to_app app
  @req = nil
  @res = nil
end

Instance Method Details

#last_requestObject



16
17
18
# File 'lib/irwebmachine/application.rb', line 16

def last_request
  @req || raise(RuntimeError, "No active request.", [])
end

#last_responseObject



12
13
14
# File 'lib/irwebmachine/application.rb', line 12

def last_response
  @res || raise(RuntimeError, "No active request.", [])
end

#unboxObject



8
9
10
# File 'lib/irwebmachine/application.rb', line 8

def unbox
  @app
end