Sha256: fec7944d94c826b67ca872463a0bcc3d76199f3313508452d9108bf5f6dd21c0

Contents?: true

Size: 460 Bytes

Versions: 11

Compression:

Stored size: 460 Bytes

Contents

module FactoryGirl
  class Attribute
    # @api private
    class Dynamic < Attribute
      def initialize(name, ignored, block)
        super(name, ignored)
        @block = block
      end

      def to_proc
        block = @block

        -> {
          value = block.arity == 1 ? instance_exec(self, &block) : instance_exec(&block)
          raise SequenceAbuseError if FactoryGirl::Sequence === value
          value
        }
      end
    end
  end
end

Version data entries

11 entries across 8 versions & 4 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/factory_girl-4.5.0/lib/factory_girl/attribute/dynamic.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/attribute/dynamic.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/attribute/dynamic.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl-4.5.0/lib/factory_girl/attribute/dynamic.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/lib/factory_girl/attribute/dynamic.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/lib/factory_girl/attribute/dynamic.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/lib/factory_girl/attribute/dynamic.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/lib/factory_girl/attribute/dynamic.rb
factory_girl-4.5.0 lib/factory_girl/attribute/dynamic.rb
factory_girl-4.4.0 lib/factory_girl/attribute/dynamic.rb
factory_girl-4.3.0 lib/factory_girl/attribute/dynamic.rb