Class: FriendlyRoutes::MultiComposer

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_routes/services/multi_composer.rb

Overview

Compoer will map passed params to friendly_route params

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(routes, params = {}) ⇒ MultiComposer

Returns a new instance of MultiComposer.



8
9
10
11
# File 'lib/friendly_routes/services/multi_composer.rb', line 8

def initialize(routes, params = {})
  @routes = routes
  @params = params.dup
end

Instance Attribute Details

#matched_routeObject (readonly)

Returns the value of attribute matched_route.



6
7
8
# File 'lib/friendly_routes/services/multi_composer.rb', line 6

def matched_route
  @matched_route
end

Instance Method Details

#callObject



13
14
15
16
# File 'lib/friendly_routes/services/multi_composer.rb', line 13

def call
  compose unless @composed_params
  @composed_params
end