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.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 7 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.
5 6 7 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 5 def as @as end |
#controllers ⇒ Object
Returns the value of attribute controllers.
5 6 7 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 5 def controllers @controllers end |
#skips ⇒ Object
Returns the value of attribute skips.
5 6 7 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 5 def skips @skips end |
Instance Method Details
#[](routes) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 26 def [](routes) { :controllers => @controllers[routes], :as => @as[routes] } end |
#skipped?(controller) ⇒ Boolean
33 34 35 |
# File 'lib/doorkeeper/rails/routes/mapping.rb', line 33 def skipped?(controller) return @skips.include?(controller) end |