Sha256: b2573f75f9553f78511215597d2a7311152f3f9df580ec225659d8424661293f
Contents?: true
Size: 745 Bytes
Versions: 94
Compression:
Stored size: 745 Bytes
Contents
module Search class Document attr_reader :doc_type, :config, :path def initialize(doc_type, config, path) @doc_type = doc_type @config = config @path = Pathname.new(path) end def articles @articles ||= Nokogiri::HTML(body).split_html.map do |section_html| Search::Article.new(self, section_html) end end def document @document ||= File.read(@path) end def frontmatter @frontmatter ||= YAML.safe_load(document) end def title @title ||= frontmatter['title'] end def description @description ||= frontmatter['description'] end def body @body ||= Nexmo::Markdown::Renderer.new.call(document) end end end
Version data entries
94 entries across 94 versions & 1 rubygems