class Beckett::Document

Public Class Methods

new(content) click to toggle source
# File lib/beckett.rb, line 21
def initialize(content)
  @content = content
end

Public Instance Methods

to_hash() click to toggle source
# File lib/beckett.rb, line 25
def to_hash
  document = Kramdown::Document.new(@content, input: 'GFM')
  renderer = Renderer.send(:new, document.root)
  renderer.convert(document.root)
end
to_json() click to toggle source
# File lib/beckett.rb, line 31
def to_json
  to_hash.to_json
end