Sha256: f0d18219f5ba663a0bb34dd7e1e292a4603c20461d6e4cf9856c1bb098bb72bb

Contents?: true

Size: 322 Bytes

Versions: 7

Compression:

Stored size: 322 Bytes

Contents

module NishisukeBlogSyntax
  module Formatter
    class FormatterBase
      def format(txt)
        txt.gsub(regexp) { |matched| substitute(matched) }
      end

      private

      def regexp
        raise NotImplementedError
      end

      def substitute
        raise NotImplementedError
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
nishisuke_blog_syntax-0.1.8 lib/nishisuke_blog_syntax/formatter.rb
nishisuke-blog-syntax-0.1.7 lib/nishisuke_blog_syntax/formatter.rb
nishisuke-blog-syntax-0.1.6 lib/nishisuke_blog_syntax/formatter.rb
nishisuke-blog-syntax-0.1.5 lib/nishisuke_blog_syntax/formatter.rb
nishisuke-blog-syntax-0.1.4 lib/nishisuke_blog_syntax/formatter.rb
nishisuke-blog-syntax-0.1.3 lib/nishisuke_blog_syntax/formatter.rb
nishisuke-blog-syntax-0.1.2 lib/nishisuke_blog_syntax/formatter.rb