Sha256: 9a4a1fa1cb189e1ab383192bfc383f2d939ca9a70a59545a8d2d9472764fabaa
Contents?: true
Size: 477 Bytes
Versions: 6
Compression:
Stored size: 477 Bytes
Contents
require_relative './base_node_renderer' module RichTextRenderer # Catch-all renderer for missing node types class NullRenderer < BaseNodeRenderer # Will raise an exception indicating the missing node type. def render(node) fail "No renderer defined for '#{node_type(node)}' nodes" end private def node_type(node) return node['nodeType'] if node.key?('nodeType') return node['type'] if node.key?('type') node end end end
Version data entries
6 entries across 6 versions & 1 rubygems