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
opal-factory_girl-4.5.0.3 factory_girl/lib/factory_girl/decorator/class_key_hash.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/factory_girl-4.5.0/lib/factory_girl/decorator/class_key_hash.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/decorator/class_key_hash.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/decorator/class_key_hash.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/decorator/class_key_hash.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/lib/factory_girl/decorator/class_key_hash.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/lib/factory_girl/decorator/class_key_hash.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/lib/factory_girl/decorator/class_key_hash.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/lib/factory_girl/decorator/class_key_hash.rb
factory_girl-4.5.0 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-4.4.0 lib/factory_girl/decorator/class_key_hash.rb
factory_girl-4.3.0 lib/factory_girl/decorator/class_key_hash.rb
challah-1.0.0 vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/decorator/class_key_hash.rb
challah-1.0.0.beta3 vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/decorator/class_key_hash.rb
challah-1.0.0.beta2 vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/decorator/class_key_hash.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.2.0/lib/factory_girl/decorator/class_key_hash.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/decorator/class_key_hash.rb
challah-0.9.1.beta.3 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/decorator/class_key_hash.rb
factory_girl-4.2.0 lib/factory_girl/decorator/class_key_hash.rb
challah-0.9.1.beta vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/decorator/class_key_hash.rb