Sha256: 5364e3c650eb2b22e8bbbd6954e056cfddb4d3f0663be6d785c40f40e81c7705

Contents?: true

Size: 612 Bytes

Versions: 7

Compression:

Stored size: 612 Bytes

Contents

class Rack::App::Router::Static

  def add_endpoint(request_method, request_path, endpoint)
    @endpoints[[request_method.to_s.upcase, Rack::App::Utils.normalize_path(request_path)]]= endpoint
  end

  def fetch_endpoint(request_method, request_path)
    @endpoints[[request_method, request_path]]
  end

  def merge!(static_router)
    raise(ArgumentError,"Invalid argument given, must be instance of a #{self.class.to_s}") unless static_router.is_a?(self.class)
    @endpoints.merge!(static_router.instance_variable_get(:@endpoints))
    nil
  end

  protected

  def initialize
    @endpoints = {}
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rack-app-0.8.2 lib/rack/app/router/static.rb
rack-app-0.8.1 lib/rack/app/router/static.rb
rack-app-0.7.0 lib/rack/app/router/static.rb
rack-app-0.6.0 lib/rack/app/router/static.rb
rack-app-0.5.0 lib/rack/app/router/static.rb
rack-app-0.4.0 lib/rack/app/router/static.rb
rack-app-0.3.0 lib/rack/app/router/static.rb