Class: PrawnHtml::Instance
- Inherits:
-
Object
- Object
- PrawnHtml::Instance
- Defined in:
- lib/prawn_html/instance.rb
Instance Attribute Summary collapse
-
#html_parser ⇒ Object
readonly
Returns the value of attribute html_parser.
-
#pdf_wrapper ⇒ Object
readonly
Returns the value of attribute pdf_wrapper.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
Instance Method Summary collapse
- #append(css: nil, html: nil) ⇒ Object
-
#initialize(pdf) ⇒ Instance
constructor
A new instance of Instance.
Constructor Details
#initialize(pdf) ⇒ Instance
Returns a new instance of Instance.
7 8 9 10 11 |
# File 'lib/prawn_html/instance.rb', line 7 def initialize(pdf) @pdf_wrapper = PrawnHtml::PdfWrapper.new(pdf) @renderer = PrawnHtml::DocumentRenderer.new(@pdf_wrapper) @html_parser = PrawnHtml::HtmlParser.new(@renderer) end |
Instance Attribute Details
#html_parser ⇒ Object (readonly)
Returns the value of attribute html_parser.
5 6 7 |
# File 'lib/prawn_html/instance.rb', line 5 def html_parser @html_parser end |
#pdf_wrapper ⇒ Object (readonly)
Returns the value of attribute pdf_wrapper.
5 6 7 |
# File 'lib/prawn_html/instance.rb', line 5 def pdf_wrapper @pdf_wrapper end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
5 6 7 |
# File 'lib/prawn_html/instance.rb', line 5 def renderer @renderer end |
Instance Method Details
#append(css: nil, html: nil) ⇒ Object
13 14 15 16 |
# File 'lib/prawn_html/instance.rb', line 13 def append(css: nil, html: nil) html_parser.parse_styles(css) if css html_parser.process(html) if html end |