Sha256: 820085ff31e5e600545d3574412c5dec8f7f34080ea782acbb2088b5c3db3e4d

Contents?: true

Size: 376 Bytes

Versions: 6

Compression:

Stored size: 376 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] = send(attribute_name)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
factory_bot-4.11.1 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-4.11.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-4.10.0 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-4.8.2 lib/factory_bot/decorator/attribute_hash.rb
factory_bot-1.0.1.alpha lib/factory_bot/decorator/attribute_hash.rb
factory_bot-1.0.0.alpha lib/factory_bot/decorator/attribute_hash.rb