Sha256: ddc45de2898242030e7d76ff6a54ab69b68123bfc2facdb4e0e878baed3bbde9

Contents?: true

Size: 577 Bytes

Versions: 15

Compression:

Stored size: 577 Bytes

Contents

class Factory
  class Proxy #:nodoc:
    class Build < Proxy #:nodoc:
      def initialize(klass)
        @instance = klass.new
      end

      def get(attribute)
        @instance.send(attribute)
      end

      def set(attribute, value)
        @instance.send(:"#{attribute}=", value)
      end

      def associate(name, factory, attributes)
        set(name, Factory.create(factory, attributes))
      end

      def association(factory, overrides = {})
        Factory.create(factory, overrides)
      end

      def result
        @instance
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 8 rubygems

Version Path
BrettRasmussen-factory_girl-1.2.2 lib/factory_girl/proxy/build.rb
BrettRasmussen-factory_girl-1.2.3 lib/factory_girl/proxy/build.rb
agibralter-factory_girl-1.2.1 lib/factory_girl/proxy/build.rb
lacomartincik-factory_girl-1.2.1.1 lib/factory_girl/proxy/build.rb
qrush-factory_girl-1.2.1.1 lib/factory_girl/proxy/build.rb
thoughtbot-factory_girl-1.2.0 lib/factory_girl/proxy/build.rb
thoughtbot-factory_girl-1.2.1 lib/factory_girl/proxy/build.rb
thoughtbot-factory_girl-1.2.2 lib/factory_girl/proxy/build.rb
ttilley-factory_girl-1.2.2.1 lib/factory_girl/proxy/build.rb
ttilley-factory_girl-1.2.2.2 lib/factory_girl/proxy/build.rb
ttilley-factory_girl-1.2.2 lib/factory_girl/proxy/build.rb
factory_girl-1.2.0 lib/factory_girl/proxy/build.rb
factory_girl-1.2.1 lib/factory_girl/proxy/build.rb
freegenie-factory_girl-1.2.2 lib/factory_girl/proxy/build.rb
factory_girl-1.2.2 lib/factory_girl/proxy/build.rb