Sha256: d4586696edbdc81b803136b0dd1248213635945e213e87a093be950f94cb1e5c

Contents?: true

Size: 491 Bytes

Versions: 50

Compression:

Stored size: 491 Bytes

Contents

module FactoryGirl
  class Decorator
    class ClassKeyHash < Decorator
      def [](key)
        @component[symbolized_key key]
      end

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

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

      private

      def symbolized_key(key)
        if key.respond_to?(:to_sym)
          key.to_sym
        else
          key.to_s.underscore.to_sym
        end
      end
    end
  end
end

Version data entries

50 entries across 38 versions & 8 rubygems

Version Path
factory_girl-4.0.0 lib/factory_girl/decorator/class_key_hash.rb
challah-0.7.0.pre vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/decorator/class_key_hash.rb
factory_girl-4.0.0.rc1 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-3.6.1 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-3.6.0 lib/factory_girl/decorator/class_key_hash.rb
challah-0.6.2 vendor/bundle/gems/factory_girl-3.5.0/lib/factory_girl/decorator/class_key_hash.rb
factory_girl-3.5.0 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-3.4.2 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-3.4.1 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-3.4.0 lib/factory_girl/decorator/class_key_hash.rb