Class: Kraftwerk::Router
- Inherits:
-
Object
- Object
- Kraftwerk::Router
- Defined in:
- lib/kraftwerk/router.rb
Constant Summary collapse
- DEFAULT_RESPONSE =
[ 404, { 'X-Cascade' => 'pass', 'Content-Type' => 'application/json' }, [JSON.dump(error: 'not found')] ].freeze
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Router
constructor
A new instance of Router.
Constructor Details
#initialize(&block) ⇒ Router
Returns a new instance of Router.
17 18 19 |
# File 'lib/kraftwerk/router.rb', line 17 def initialize(&block) @routes = create_routing(&Proc.new(&block)) end |
Instance Attribute Details
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
15 16 17 |
# File 'lib/kraftwerk/router.rb', line 15 def routes @routes end |