Class: RoutingFilter::ResultWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/routing_filter/result_wrapper.rb

Defined Under Namespace

Classes: RouteWithParams

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ResultWrapper

Returns a new instance of ResultWrapper.



11
12
13
14
# File 'lib/routing_filter/result_wrapper.rb', line 11

def initialize(result)
  @url = result.path(nil)
  @params = result.params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



9
10
11
# File 'lib/routing_filter/result_wrapper.rb', line 9

def params
  @params
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/routing_filter/result_wrapper.rb', line 9

def url
  @url
end

Instance Method Details

#generateObject



20
21
22
# File 'lib/routing_filter/result_wrapper.rb', line 20

def generate
  RouteWithParams.new(url, params)
end

#update(url) ⇒ Object



16
17
18
# File 'lib/routing_filter/result_wrapper.rb', line 16

def update(url)
  @url = url
end