Sha256: ea38063b4413efcf75e3be27da77d298fff9f33ff7aa8fc539473bc934bdc4a3

Contents?: true

Size: 876 Bytes

Versions: 31

Compression:

Stored size: 876 Bytes

Contents

module Doorkeeper
  module Rails
    class Routes
      class Mapping
        attr_accessor :controllers, :as, :skips

        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

        def [](routes)
          {
            controllers: @controllers[routes],
            as: @as[routes]
          }
        end

        def skipped?(controller)
          @skips.include?(controller)
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
doorkeeper-4.2.0 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-4.1.0 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-4.0.0 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-4.0.0.rc4 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-4.0.0.rc3 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-4.0.0.rc2 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-4.0.0.rc1 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-3.1.0 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-3.0.1 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.2.2 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-3.0.0 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-3.0.0.rc2 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-3.0.0.rc1 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.2.1 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.2.0 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.1.4 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-1.4.2 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.1.3 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.1.2 lib/doorkeeper/rails/routes/mapping.rb
doorkeeper-2.1.1 lib/doorkeeper/rails/routes/mapping.rb