Sha256: ad6525a7478b61059bf2065166d6a03a99f51bbc81fdb207318dd0a64848e0c7

Contents?: true

Size: 476 Bytes

Versions: 8

Compression:

Stored size: 476 Bytes

Contents

module Sablon
  class Numbering
    include Singleton
    attr_reader :definitions

    Definition = Struct.new(:numid, :style) do
      def inspect
        "#<Numbering #{numid}:#{style}"
      end
    end

    def initialize
      reset!
    end

    def reset!
      @numid = 1000
      @definitions = []
    end

    def register(style)
      @numid += 1
      definition = Definition.new(@numid, style)
      @definitions << definition
      definition
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sablon-0.0.21 lib/sablon/numbering.rb
sablon-0.0.20 lib/sablon/numbering.rb
sablon-0.0.19 lib/sablon/numbering.rb
sablon-0.0.19.beta5 lib/sablon/numbering.rb
sablon-0.0.19.beta4 lib/sablon/numbering.rb
sablon-0.0.19.beta3 lib/sablon/numbering.rb
sablon-0.0.19.beta2 lib/sablon/numbering.rb
sablon-0.0.19.beta1 lib/sablon/numbering.rb