Class: Capcoauth::Rails::Routes::Mapping
- Inherits:
-
Object
- Object
- Capcoauth::Rails::Routes::Mapping
- Defined in:
- lib/capcoauth/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.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/capcoauth/rails/routes/mapping.rb', line 7 def initialize @controllers = { login: 'capcoauth/login', logout: 'capcoauth/logout', callback: 'capcoauth/callback', } @as = { login: :login, logout: :logout, callback: :callback } @skips = [] end |
Instance Attribute Details
#as ⇒ Object
Returns the value of attribute as.
5 6 7 |
# File 'lib/capcoauth/rails/routes/mapping.rb', line 5 def as @as end |
#controllers ⇒ Object
Returns the value of attribute controllers.
5 6 7 |
# File 'lib/capcoauth/rails/routes/mapping.rb', line 5 def controllers @controllers end |
#skips ⇒ Object
Returns the value of attribute skips.
5 6 7 |
# File 'lib/capcoauth/rails/routes/mapping.rb', line 5 def skips @skips end |
Instance Method Details
#[](routes) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/capcoauth/rails/routes/mapping.rb', line 23 def [](routes) { controllers: @controllers[routes], as: @as[routes] } end |
#skipped?(controller) ⇒ Boolean
30 31 32 |
# File 'lib/capcoauth/rails/routes/mapping.rb', line 30 def skipped?(controller) @skips.include?(controller) end |