Sha256: f14af23d6132691c40f90be212b3b46f32567359f24367eca8704408aa9754b7

Contents?: true

Size: 638 Bytes

Versions: 19

Compression:

Stored size: 638 Bytes

Contents

module Nwiki
  module Core
    class Page
      attr_reader :title, :doc

      def initialize title, doc, parser_class
        raise 'title is empty or nil' unless title
        raise 'doc is empty or nil' unless doc
        raise 'parser_class is empty or nil' unless parser_class
        @title, @doc, @parser_class = title, doc, parser_class
      end

      def encoding
        @doc.encoding
      end

      def to_html
        @parser_class.new(@doc, offset: 1).to_html
      end

      def == other
        return false unless other
        self.kind_of?(other.class) &&
        self.doc == other.doc
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
nwiki-0.3.3 lib/nwiki/core/page.rb
nwiki-0.3.2 lib/nwiki/core/page.rb
nwiki-0.3.1 lib/nwiki/core/page.rb
nwiki-0.3.0 lib/nwiki/core/page.rb
nwiki-0.2.11 lib/nwiki/core/page.rb
nwiki-0.2.10 lib/nwiki/core/page.rb
nwiki-0.2.9 lib/nwiki/core/page.rb
nwiki-0.2.8 lib/nwiki/core/page.rb
nwiki-0.2.7 lib/nwiki/core/page.rb
nwiki-0.2.6 lib/nwiki/core/page.rb
nwiki-0.2.5 lib/nwiki/core/page.rb
nwiki-0.2.4 lib/nwiki/core/page.rb
nwiki-0.2.3 lib/nwiki/core/page.rb
nwiki-0.2.2 lib/nwiki/core/page.rb
nwiki-0.2.1 lib/nwiki/core/page.rb
nwiki-0.2.0 lib/nwiki/core/page.rb
nwiki-0.1.11 lib/nwiki/core/page.rb
nwiki-0.1.10 lib/nwiki/core/page.rb
nwiki-0.1.9 lib/nwiki/core/page.rb