Class: Doorkeeper::DeviceAuthorizationGrant::Rails::Routes
- Inherits:
-
Object
- Object
- Doorkeeper::DeviceAuthorizationGrant::Rails::Routes
- Defined in:
- lib/doorkeeper/device_authorization_grant/rails/routes.rb,
lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb,
lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb
Overview
rubocop:disable Style/Documentation
Defined Under Namespace
Modules: Helper Classes: Mapper, Mapping
Instance Attribute Summary collapse
-
#routes ⇒ Object
Returns the value of attribute routes.
Class Method Summary collapse
Instance Method Summary collapse
- #generate_routes!(options) ⇒ Object
-
#initialize(routes, &block) ⇒ Routes
constructor
A new instance of Routes.
Constructor Details
#initialize(routes, &block) ⇒ Routes
Returns a new instance of Routes.
25 26 27 28 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes.rb', line 25 def initialize(routes, &block) @routes = routes @block = block end |
Instance Attribute Details
#routes ⇒ Object
Returns the value of attribute routes.
23 24 25 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes.rb', line 23 def routes @routes end |
Class Method Details
.install! ⇒ Object
17 18 19 20 21 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes.rb', line 17 def self.install! ::ActionDispatch::Routing::Mapper.include( ::Doorkeeper::DeviceAuthorizationGrant::Rails::Routes::Helper ) end |
Instance Method Details
#generate_routes!(options) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes.rb', line 31 def generate_routes!() @mapping = Mapper.new.map(&@block) routes.scope([:scope] || 'oauth', as: 'oauth') do map_route(:device_codes, :device_code_routes) map_route(:device_authorizations, :device_authorization_routes) end end |