Sha256: 444c0674adee058145d0441c3e3e20f0425406215c390620c8cf95c021816415

Contents?: true

Size: 630 Bytes

Versions: 19

Compression:

Stored size: 630 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, 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.1.8 lib/nwiki/core/page.rb
nwiki-0.1.7 lib/nwiki/core/page.rb
nwiki-0.1.6 lib/nwiki/core/page.rb
nwiki-0.1.5 lib/nwiki/core/page.rb
nwiki-0.1.4 lib/nwiki/core/page.rb
nwiki-0.1.3 lib/nwiki/core/page.rb
nwiki-0.1.2 lib/nwiki/core/page.rb
nwiki-0.1.1 lib/nwiki/core/page.rb
nwiki-0.1.0a lib/nwiki/core/page.rb
nwiki-0.0.11 lib/nwiki/core/page.rb
nwiki-0.1.0 lib/nwiki/core/page.rb
nwiki-0.0.9 lib/nwiki/core/page.rb
nwiki-0.0.8 lib/nwiki/core/page.rb
nwiki-0.0.7 lib/nwiki/core/page.rb
nwiki-0.0.6 lib/nwiki/core/page.rb
nwiki-0.0.5 lib/nwiki/core/page.rb
nwiki-0.0.4 lib/nwiki/core/page.rb
nwiki-0.0.3 lib/nwiki/core/page.rb
nwiki-0.0.2 lib/nwiki/core/page.rb