Sha256: a3d9dcfd5445e340ae306982be6fe2745f84fde813818f1cf0b13b5ed8fd6c7b

Contents?: true

Size: 805 Bytes

Versions: 5

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true

module Noid
  module Rails
    # Configuration parameters for creating identifiers
    class Config
      attr_writer :template, :statefile, :namespace, :minter_class, :identifier_in_use

      def template
        @template ||= '.reeddeeddk'
      end

      def statefile
        @statefile ||= '/tmp/minter-state'
      end

      def namespace
        @namespace ||= 'default'
      end

      def minter_class
        @minter_class ||= Minter::File
      end

      # A check to guarantee the identifier is not already in use. When true,
      # the minter will continue to cycle through ids until it finds one that
      # returns false
      def identifier_in_use
        @identifier_in_use ||= lambda do |_id|
          false
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
noid-rails-3.2.0 lib/noid/rails/config.rb
noid-rails-3.1.0 lib/noid/rails/config.rb
noid-rails-3.0.3 lib/noid/rails/config.rb
noid-rails-3.0.2 lib/noid/rails/config.rb
noid-rails-3.0.1 lib/noid/rails/config.rb