Sha256: 202379c2b615f3484faccb670db0f15d48fcff6c30c81f4eefc0067f051765dc

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require_relative 'mapping'

module Doorkeeper
  module DeviceAuthorizationGrant
    module Rails
      class Routes
        class Mapper # rubocop:disable Style/Documentation
          # @param mapping [Mapping]
          def initialize(mapping = Mapping.new)
            @mapping = mapping
          end

          # @return [Mapping]
          def map(&block)
            instance_eval(&block) if block
            @mapping
          end

          # @param controller_names [Hash{Symbol => String}]
          # @return [Hash{Symbol => String}]
          def controller(controller_names = {})
            @mapping.controllers.merge!(controller_names)
          end

          # @param controller_names [Array<Symbol>]
          def skip_controllers(*controller_names)
            @mapping.skips = controller_names
          end

          # @param alias_names [Hash{Symbol => Symbol}]
          def as(alias_names = {})
            @mapping.as.merge!(alias_names)
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
doorkeeper-device_authorization_grant-1.0.3 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-1.0.2 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-1.0.1 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-1.0.0 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-0.2.1 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-0.2.0 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-0.1.1 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb
doorkeeper-device_authorization_grant-0.1.0 lib/doorkeeper/device_authorization_grant/rails/routes/mapper.rb