Sha256: 94a32ef4a34cc11419df30c9702b0c1476a7960a86b14fb23817316a0e07b39b

Contents?: true

Size: 639 Bytes

Versions: 1

Compression:

Stored size: 639 Bytes

Contents

module Galago
  class Router
    class DSL
      def initialize(router, block)
        @router = router
        instance_eval(&block)
      end

      def get(path, options)
        @router.add_route("GET", path, options[:to])
      end

      def patch(path, options)
        @router.add_route("PATCH", path, options[:to])
      end

      def post(path, options)
        @router.add_route("POST", path, options[:to])
      end

      def put(path, options)
        @router.add_route("PUT", path, options[:to])
      end

      def delete(path, options)
        @router.add_route("DELETE", path, options[:to])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
galago-router-0.0.2 lib/galago/router/dsl.rb