Class: Doorkeeper::DeviceAuthorizationGrant::Rails::Routes::Mapping
- Inherits:
-
Object
- Object
- Doorkeeper::DeviceAuthorizationGrant::Rails::Routes::Mapping
- Defined in:
- lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb
Overview
rubocop:disable Style/Documentation
Instance Attribute Summary collapse
Instance Method Summary collapse
- #[](routes) ⇒ Hash
-
#initialize ⇒ Mapping
constructor
A new instance of Mapping.
- #skipped?(controller) ⇒ Boolean
Constructor Details
#initialize ⇒ Mapping
Returns a new instance of Mapping.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb', line 17 def initialize @controllers = { device_authorizations: 'doorkeeper/device_authorization_grant/device_authorizations', device_codes: 'doorkeeper/device_authorization_grant/device_codes' } @as = { device_authorizations: :device_authorizations, device_codes: :device_codes } @skips = [] end |
Instance Attribute Details
#as ⇒ Hash{Symbol => Symbol}
12 13 14 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb', line 12 def as @as end |
#controllers ⇒ Hash{Symbol => String}
9 10 11 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb', line 9 def controllers @controllers end |
#skips ⇒ Array<Symbol>
15 16 17 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb', line 15 def skips @skips end |
Instance Method Details
#[](routes) ⇒ Hash
33 34 35 36 37 38 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb', line 33 def [](routes) { controller: @controllers[routes], as: @as[routes] } end |
#skipped?(controller) ⇒ Boolean
42 43 44 |
# File 'lib/doorkeeper/device_authorization_grant/rails/routes/mapping.rb', line 42 def skipped?(controller) @skips.include?(controller) end |