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

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

Overview

rubocop:disable Style/Documentation

Instance Method Summary collapse

Constructor Details

#initialize(mapping = Mapping.new) ⇒ Mapper

Returns a new instance of Mapper.

Parameters:

  • mapping (Mapping) (defaults to: Mapping.new)


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

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

Instance Method Details

#as(alias_names = {}) ⇒ Object

Parameters:

  • alias_names (Hash{Symbol => Symbol}) (defaults to: {})


33
34
35
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb', line 33

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

#controller(controller_names = {}) ⇒ Hash{Symbol => String}

Parameters:

  • controller_names (Hash{Symbol => String}) (defaults to: {})

Returns:

  • (Hash{Symbol => String})


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

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

#map(&block) ⇒ Mapping

Returns:



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

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

#skip_controllers(*controller_names) ⇒ Object

Parameters:

  • controller_names (Array<Symbol>)


28
29
30
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb', line 28

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