Class: Doorkeeper::Rails::Routes::Mapping
- Inherits:
-
Object
- Object
- Doorkeeper::Rails::Routes::Mapping
- Defined in:
- lib/doorkeeper/rails/routes/mapping.rb
Instance Attribute Summary collapse
-
#as ⇒ Object
Returns the value of attribute as.
-
#controllers ⇒ Object
Returns the value of attribute controllers.
-
#skips ⇒ Object
Returns the value of attribute skips.
Instance Method Summary collapse
- #[](routes) ⇒ Object
-
#initialize ⇒ Mapping
constructor
A new instance of Mapping.
- #skipped?(controller) ⇒ Boolean
Constructor Details
#initialize ⇒ Mapping
Returns a new instance of Mapping.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 9 def initialize @controllers = { authorizations: "doorkeeper/authorizations", applications: "doorkeeper/applications", authorized_applications: "doorkeeper/authorized_applications", tokens: "doorkeeper/tokens", token_info: "doorkeeper/token_info", } @as = { authorizations: :authorization, tokens: :token, token_info: :token_info, } @skips = [] end |
Instance Attribute Details
#as ⇒ Object
Returns the value of attribute as.
7 8 9 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 7 def as @as end |
#controllers ⇒ Object
Returns the value of attribute controllers.
7 8 9 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 7 def controllers @controllers end |
#skips ⇒ Object
Returns the value of attribute skips.
7 8 9 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 7 def skips @skips end |
Instance Method Details
#[](routes) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 27 def [](routes) { controllers: @controllers[routes], as: @as[routes], } end |
#skipped?(controller) ⇒ Boolean
34 35 36 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 34 def skipped?(controller) @skips.include?(controller) end |