Class: Junior::Router

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, router) ⇒ Router

Returns a new instance of Router.



7
8
9
# File 'lib/junior/router.rb', line 7

def initialize(app, router)
  @app, @router = app, router
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/junior/router.rb', line 5

def app
  @app
end

#routerObject (readonly)

Returns the value of attribute router.



5
6
7
# File 'lib/junior/router.rb', line 5

def router
  @router
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
# File 'lib/junior/router.rb', line 11

def call(env)
  @router.call(env)
  @app.call(env)
end