Class: EnumFields::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/enum_fields/configuration.rb

Constant Summary collapse

DEFAULTS =
{
  scopeable: true,
  validatable: true,
  nullable: true,
  inquirable: true,
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
# File 'lib/enum_fields/configuration.rb', line 14

def initialize
  reset!
end

Instance Attribute Details

#inquirableObject

Returns the value of attribute inquirable.



12
13
14
# File 'lib/enum_fields/configuration.rb', line 12

def inquirable
  @inquirable
end

#nullableObject

Returns the value of attribute nullable.



12
13
14
# File 'lib/enum_fields/configuration.rb', line 12

def nullable
  @nullable
end

#scopeableObject

Returns the value of attribute scopeable.



12
13
14
# File 'lib/enum_fields/configuration.rb', line 12

def scopeable
  @scopeable
end

#validatableObject

Returns the value of attribute validatable.



12
13
14
# File 'lib/enum_fields/configuration.rb', line 12

def validatable
  @validatable
end

Instance Method Details

#reset!Object



18
19
20
# File 'lib/enum_fields/configuration.rb', line 18

def reset!
  DEFAULTS.each { |key, value| public_send("#{key}=", value) }
end