Class: Doorkeeper::Rails::Routes::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/doorkeeper/rails/routes/mapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(mapping = Mapping.new) ⇒ Mapper

Returns a new instance of Mapper.



7
8
9
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 7

def initialize(mapping = Mapping.new)
  @mapping = mapping
end

Instance Method Details

#as(alias_names = {}) ⇒ Object



24
25
26
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 24

def as(alias_names = {})
  @mapping.as.merge!(alias_names)
end

#controllers(controller_names = {}) ⇒ Object



16
17
18
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 16

def controllers(controller_names = {})
  @mapping.controllers.merge!(controller_names)
end

#map(&block) ⇒ Object



11
12
13
14
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 11

def map(&block)
  instance_eval(&block) if block
  @mapping
end

#skip_controllers(*controller_names) ⇒ Object



20
21
22
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 20

def skip_controllers(*controller_names)
  @mapping.skips = controller_names
end