Sha256: 85f2b15717469465a5f495fc3b9efc654078dd621d6a600d64a0153a041b91cd

Contents?: true

Size: 493 Bytes

Versions: 10

Compression:

Stored size: 493 Bytes

Contents

require 'pathname'

require 'dry/core/inflector'
require 'rom/types'
require 'rom/setup/auto_registration_strategies/base'

module ROM
  module AutoRegistrationStrategies
    class NoNamespace < Base
      option :directory, reader: true, type: PathnameType
      option :entity, reader: true, type: Types::Strict::Symbol

      def call
        Dry::Core::Inflector.camelize(
          file.sub(/^#{directory}\/#{entity}\//, '').sub(EXTENSION_REGEX, '')
        )
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rom-3.1.0 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.3 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.2 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.1 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.0 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.0.rc2 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.0.rc1 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.0.beta3 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.0.beta2 lib/rom/setup/auto_registration_strategies/no_namespace.rb
rom-3.0.0.beta1 lib/rom/setup/auto_registration_strategies/no_namespace.rb