Sha256: fb610ace2da2494c27000d55c96d87de6bd5fbaf9b4334b6bfac903452020b8c

Contents?: true

Size: 387 Bytes

Versions: 25

Compression:

Stored size: 387 Bytes

Contents

module FactoryBot
  class Decorator
    class AttributeHash < Decorator
      def initialize(component, attributes = [])
        super(component)
        @attributes = attributes
      end

      def attributes
        @attributes.each_with_object({}) do |attribute_name, result|
          result[attribute_name] = @component.send(attribute_name)
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
factory_bot-6.5.0 lib/factory_bot/decorator/attribute_hash.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/factory_bot-6.4.6/lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.6 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.5 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.4 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.3 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.2 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.1 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.4.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.3.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.2.1 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.2.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.1.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.0.2 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.0.1 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-6.0.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-5.2.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-5.1.2 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-5.1.1 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-5.1.0 lib/factory_bot/decorator/attribute_hash.rb