Sha256: b4b61d962084838fa94f687d065125cab3ee7925027b29d8157a3f098ab3f664

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

module FactoryGirl
  class Proxy #:nodoc:
    class AttributesFor < Proxy #:nodoc:
      def initialize(klass)
        super(klass)
        @hash = {}
        @ignored_attributes = {}
      end

      def get(attribute)
        @ignored_attributes[attribute] || @hash[attribute]
      end

      def set(attribute, value, ignored = false)
        if ignored
          @ignored_attributes[attribute] = value
        else
          @hash[attribute] = value
        end
      end

      def result(to_create)
        @hash
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
factory_girl-2.1.2 lib/factory_girl/proxy/attributes_for.rb