class FactoryGirl::Decorator::ClassKeyHash

Public Instance Methods

[](key) click to toggle source
# File lib/factory_girl/decorator/class_key_hash.rb, line 4
def [](key)
  @component[symbolized_key key]
end
[]=(key, value) click to toggle source
# File lib/factory_girl/decorator/class_key_hash.rb, line 8
def []=(key, value)
  @component[symbolized_key key] = value
end
key?(key) click to toggle source
# File lib/factory_girl/decorator/class_key_hash.rb, line 12
def key?(key)
  @component.key? symbolized_key(key)
end

Private Instance Methods

symbolized_key(key) click to toggle source
# File lib/factory_girl/decorator/class_key_hash.rb, line 18
def symbolized_key(key)
  if key.respond_to?(:to_sym)
    key.to_sym
  elsif FactoryGirl.allow_class_lookup
    ActiveSupport::Deprecation.warn "Looking up factories by class is deprecated and will be removed in 5.0. Use symbols instead and set FactoryGirl.allow_class_lookup = false", caller
    key.to_s.underscore.to_sym
  end
end