Class: Slippery::Document
- Inherits:
-
Object
- Object
- Slippery::Document
- Includes:
- Hexp
- Defined in:
- lib/slippery/document.rb
Instance Method Summary collapse
-
#initialize(markdown) ⇒ Document
constructor
A new instance of Document.
- #kramdown_document ⇒ Object
- #to_hexp ⇒ Object
Constructor Details
#initialize(markdown) ⇒ Document
Returns a new instance of Document.
7 8 9 |
# File 'lib/slippery/document.rb', line 7 def initialize(markdown) @markdown = markdown end |
Instance Method Details
#kramdown_document ⇒ Object
11 12 13 |
# File 'lib/slippery/document.rb', line 11 def kramdown_document @kramdown_document ||= Kramdown::Document.new(@markdown, input: 'GFM') end |
#to_hexp ⇒ Object
15 16 17 |
# File 'lib/slippery/document.rb', line 15 def to_hexp @hexp ||= Slippery::Converter.new.convert(kramdown_document.root).to_hexp end |