Sha256: 4cd15e8ae440e4e2b059341aea4ad69fd44b8dab90e84abb133fb8e061dbc5f9

Contents?: true

Size: 622 Bytes

Versions: 6

Compression:

Stored size: 622 Bytes

Contents

# frozen_string_literal: true

module Enumerations
  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield(configuration)
  end

  def self.restore_default_configuration
    @configuration = nil
  end

  class Configuration
    attr_accessor :primary_key
    attr_accessor :foreign_key_suffix
    attr_accessor :translate_attributes
    attr_accessor :raise_invalid_value_error

    def initialize
      @primary_key               = nil
      @foreign_key_suffix        = nil
      @translate_attributes      = true
      @raise_invalid_value_error = true
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enumerations-2.6.0 lib/enumerations/configuration.rb
enumerations-2.5.4 lib/enumerations/configuration.rb
enumerations-2.5.3 lib/enumerations/configuration.rb
enumerations-2.5.2 lib/enumerations/configuration.rb
enumerations-2.5.1 lib/enumerations/configuration.rb
enumerations-2.5.0 lib/enumerations/configuration.rb