Class: HttpRouter::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/http_router/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, path) ⇒ Response

Returns a new instance of Response.



4
5
6
7
# File 'lib/http_router/response.rb', line 4

def initialize(request, path)
  super(request, path)
  @params = path.hashify_params(request.params)
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/http_router/response.rb', line 3

def params
  @params
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



2
3
4
# File 'lib/http_router/response.rb', line 2

def path
  @path
end

#requestObject

Returns the value of attribute request

Returns:

  • (Object)

    the current value of request



2
3
4
# File 'lib/http_router/response.rb', line 2

def request
  @request
end

Instance Method Details

#param_valuesObject



13
14
15
# File 'lib/http_router/response.rb', line 13

def param_values
  request.params
end

#routeObject



9
10
11
# File 'lib/http_router/response.rb', line 9

def route
  path.route
end