Class: FocusedController::RouteMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/focused_controller/route_mapper.rb

Overview

The monkey-patching in this file makes me sadface but I can’t see another way ;(

Instance Method Summary collapse

Constructor Details

#initialize(scope, options) ⇒ RouteMapper

Returns a new instance of RouteMapper.



8
9
10
# File 'lib/focused_controller/route_mapper.rb', line 8

def initialize(scope, options)
  @scope, @options = scope, options
end

Instance Method Details

#optionsObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/focused_controller/route_mapper.rb', line 12

def options
  options = @options.dup

  if to = to_option
    options[:action]     = FocusedController.action_name
    options[:controller] = to.underscore

    options.delete :to
  end

  options
end