Class: Kangaru::Router
- Inherits:
-
Object
- Object
- Kangaru::Router
- Defined in:
- lib/kangaru/router.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(namespace: Object) ⇒ Router
constructor
A new instance of Router.
- #resolve(request) ⇒ Object
Constructor Details
#initialize(namespace: Object) ⇒ Router
Returns a new instance of Router.
8 9 10 |
# File 'lib/kangaru/router.rb', line 8 def initialize(namespace: Object) @namespace = namespace end |
Instance Attribute Details
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/kangaru/router.rb', line 6 def namespace @namespace end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/kangaru/router.rb', line 6 def request @request end |
Instance Method Details
#resolve(request) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/kangaru/router.rb', line 12 def resolve(request) @request = request validate_controller_defined! validate_action_defined! controller_class.new(request).execute end |