Sha256: f3273db15d4895b2e4e5e1902bc7e7ddbeca0185865979716338942f05b9fb99

Contents?: true

Size: 353 Bytes

Versions: 6

Compression:

Stored size: 353 Bytes

Contents

module Rouge
  class Formatter
    REGISTRY = {}

    def self.tag(tag=nil)
      return @tag unless tag
      REGISTRY[tag] = self

      @tag = tag
    end

    def self.find(tag)
      REGISTRY[tag]
    end

    def render(tokens)
      enum_for(:stream, tokens).to_a.join
    end

    def stream(tokens, &b)
      raise 'abstract'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rouge-0.2.0 lib/rouge/formatter.rb
rouge-0.1.2 lib/rouge/formatter.rb
rouge-0.1.1 lib/rouge/formatter.rb
rouge-0.1.0 lib/rouge/formatter.rb
rouge-0.1.0.rc1 lib/rouge/formatter.rb
rouge-0.0.14 lib/rouge/formatter.rb