Sha256: a0da0477ad29f34397e4079caca434eedfb89c53a9fa32c44aaca84f563b321e

Contents?: true

Size: 375 Bytes

Versions: 6

Compression:

Stored size: 375 Bytes

Contents

class Factory
  class Attribute #:nodoc:

    class Dynamic < Attribute  #:nodoc:
      def initialize(name, block)
        super(name)
        @block = block
      end

      def add_to(proxy)
        value = @block.call(proxy)
        if Factory::Sequence === value
          raise SequenceAbuseError
        end
        proxy.set(name, value)
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 5 rubygems

Version Path
BrettRasmussen-factory_girl-1.2.2 lib/factory_girl/attribute/dynamic.rb
BrettRasmussen-factory_girl-1.2.3 lib/factory_girl/attribute/dynamic.rb
agibralter-factory_girl-1.2.1 lib/factory_girl/attribute/dynamic.rb
lacomartincik-factory_girl-1.2.1.1 lib/factory_girl/attribute/dynamic.rb
masa-iwasaki-factory_girl-1.2.1.1 lib/factory_girl/attribute/dynamic.rb
qrush-factory_girl-1.2.1.1 lib/factory_girl/attribute/dynamic.rb