Class: Burr::Converter

Inherits:
Object show all
Defined in:
lib/burr/converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(book) ⇒ Converter

Returns a new instance of Converter.



6
7
8
# File 'lib/burr/converter.rb', line 6

def initialize(book)
  @book = book
end

Instance Attribute Details

#bookObject

Returns the value of attribute book.



4
5
6
# File 'lib/burr/converter.rb', line 4

def book
  @book
end

Instance Method Details

#convert(text) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/burr/converter.rb', line 10

def convert(text)
    ::Kramdown::Document.new(text,
                             :input    => 'Bsmarkdown',
                             :auto_ids => false,
                             :register => self.book
                            ).to_bshtml
end