Sha256: 47bce2be42474fa7664e4c88f939b8baecff437b8ffd8bc9502041a221af66a0

Contents?: true

Size: 547 Bytes

Versions: 5

Compression:

Stored size: 547 Bytes

Contents

require 'diesel/middleware_builder'
require 'diesel/middleware_stack'

module Diesel
  class Endpoint
    attr_reader :name, :url, :request_method

    def initialize(name, url, request_method)
      @name, @url, @request_method = name, url, request_method
    end

    def middlewares
      @middlewares ||= []
    end

    def middleware_stack
      @middleware_stack ||= MiddlewareStack.new(middlewares)
    end

    def config_middleware(&block)
      builder = MiddlewareBuilder.new(middlewares)
      builder.build(&block)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
diesel-api-dsl-0.1.5 lib/diesel/endpoint.rb
diesel-api-dsl-0.1.3 lib/diesel/endpoint.rb
diesel-api-dsl-0.1.2 lib/diesel/endpoint.rb
diesel-api-dsl-0.1.1 lib/diesel/endpoint.rb
diesel-api-dsl-0.1.0 lib/diesel/endpoint.rb