Class: Fasta::Router
- Inherits:
-
Object
- Object
- Fasta::Router
- Defined in:
- lib/fasta/services/router.rb
Instance Attribute Summary collapse
-
#router ⇒ Object
readonly
Returns the value of attribute router.
Instance Method Summary collapse
-
#initialize ⇒ Router
constructor
A new instance of Router.
- #runnable ⇒ Object
Constructor Details
#initialize ⇒ Router
Returns a new instance of Router.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/fasta/services/router.rb', line 6 def initialize @router = Hanami::Router.new do action = ->(klass) { ->(env) { klass.call(env) } } root to: ->(_env) { [200, {}, ['Welcome to API']] } mapper = Fasta::RoutesMapper.new(action, self) yield(mapper) end end |
Instance Attribute Details
#router ⇒ Object (readonly)
Returns the value of attribute router.
21 22 23 |
# File 'lib/fasta/services/router.rb', line 21 def router @router end |
Instance Method Details
#runnable ⇒ Object
17 18 19 |
# File 'lib/fasta/services/router.rb', line 17 def runnable router end |