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.


5
6
7
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 5

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

Instance Method Details

#as(alias_names = {}) ⇒ Object


22
23
24
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 22

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

#controllers(controller_names = {}) ⇒ Object


14
15
16
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 14

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

#map(&block) ⇒ Object


9
10
11
12
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 9

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

#skip_controllers(*controller_names) ⇒ Object


18
19
20
# File 'lib/doorkeeper/rails/routes/mapper.rb', line 18

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