Class: FactoryBot::Decorator::ClassKeyHash

Inherits:
FactoryBot::Decorator show all
Defined in:
lib/factory_bot/decorator/class_key_hash.rb

Instance Method Summary collapse

Methods inherited from FactoryBot::Decorator

const_missing, #initialize, #method_missing, #send

Constructor Details

This class inherits a constructor from FactoryBot::Decorator

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FactoryBot::Decorator

Instance Method Details

#[](key) ⇒ Object


4
5
6
# File 'lib/factory_bot/decorator/class_key_hash.rb', line 4

def [](key)
  @component[symbolized_key key]
end

#[]=(key, value) ⇒ Object


8
9
10
# File 'lib/factory_bot/decorator/class_key_hash.rb', line 8

def []=(key, value)
  @component[symbolized_key key] = value
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/factory_bot/decorator/class_key_hash.rb', line 12

def key?(key)
  @component.key? symbolized_key(key)
end