Skip to content

with self yield in router #25

@watzon

Description

@watzon

If the #on method were to yield as with self yield self rather than simply yield self it would switch the entire context to self rather than just yielding self to the block. This would allow for slightly more idomatic routing as you could then do

Onyx::HTTP.on "/api" do
  get "/ping", Endpoints::API::Ping
end

Instead of

Onyx::HTTP.on "/api" do |router|
  router.get "/ping", Endpoints::API::Ping
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions