Sha256: a2ded8c72c348067da3f894910cab32831813a04769e7d598f68a896688b40b8

Contents?: true

Size: 267 Bytes

Versions: 2

Compression:

Stored size: 267 Bytes

Contents

module Makers
  class Sequence

    def initialize(&block)
      @index = 0
      @block = block
    end

    def generate(context)
      @index += 1
      if @block
        context.instance_exec @index, &@block
      else
        @index
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
makers-0.1.3 lib/makers/sequence.rb
makers-0.1.2 lib/makers/sequence.rb