Sha256: 0d86b8a35966636a1613a411a901b3d3d6ad7c068523052994ad2bc4a5a6eb06

Contents?: true

Size: 499 Bytes

Versions: 8

Compression:

Stored size: 499 Bytes

Contents

require 'pathname'

module Markout

  class Formatter

    def initialize(document, options={})
      @document = document
      @options  = options
      @format   = self.class.to_s.gsub(/^.*::/, '').downcase
    end

    def export
      raise NoMethodError, "Return String in `export()` method of your formatter (#{@format})"
    end

    def filename
      basename = File.basename(@document.path).split('.')
      ext = basename.pop
      "#{basename.join('.')}.#{@format}"
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
karmi-markout-0.0.0 lib/markout/formatter.rb
karmi-markout-0.1.0 lib/markout/formatter.rb
karmi-markout-0.1.1 lib/markout/formatter.rb
karmi-markout-0.1.2 lib/markout/formatter.rb
karmi-markout-0.1.3 lib/markout/formatter.rb
karmi-markout-0.1.5 lib/markout/formatter.rb
karmi-markout-0.1.6 lib/markout/formatter.rb
karmi-markout-0.1.7 lib/markout/formatter.rb