Class: FactoryBotFactory::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_bot_factory/config.rb

Constant Summary collapse

DEFAULT_CONVERTERS =
{
  hash_converter:        Converters::HashConverter,
  string_converter:      Converters::StringConverter,
  numertic_converter:    Converters::NumericConverter,
  open_struct_converter: Converters::HashConverter,
  nil_converter:         Converters::NilConverter
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



13
14
15
16
# File 'lib/factory_bot_factory/config.rb', line 13

def initialize(options = {})
  options = DEFAULT_CONVERTERS.merge(options)
  options.each { |k, v| instance_variable_set(:"@#{k}", v) }
end

Instance Attribute Details

#hash_converterObject

Returns the value of attribute hash_converter.



11
12
13
# File 'lib/factory_bot_factory/config.rb', line 11

def hash_converter
  @hash_converter
end

#nil_converterObject

Returns the value of attribute nil_converter.



11
12
13
# File 'lib/factory_bot_factory/config.rb', line 11

def nil_converter
  @nil_converter
end

#numertic_converterObject

Returns the value of attribute numertic_converter.



11
12
13
# File 'lib/factory_bot_factory/config.rb', line 11

def numertic_converter
  @numertic_converter
end

#open_struct_converterObject

Returns the value of attribute open_struct_converter.



11
12
13
# File 'lib/factory_bot_factory/config.rb', line 11

def open_struct_converter
  @open_struct_converter
end

#string_converterObject

Returns the value of attribute string_converter.



11
12
13
# File 'lib/factory_bot_factory/config.rb', line 11

def string_converter
  @string_converter
end