Class: PrawnHtml::Tags::Pre

Inherits:
PrawnHtml::Tag show all
Defined in:
lib/prawn_html/tags/pre.rb

Constant Summary collapse

ELEMENTS =
[:pre].freeze
MARGIN_BOTTOM =
14
MARGIN_TOP =
14

Constants inherited from PrawnHtml::Tag

PrawnHtml::Tag::CALLBACKS, PrawnHtml::Tag::TAG_CLASSES

Instance Attribute Summary

Attributes inherited from PrawnHtml::Tag

#attrs, #parent, #tag

Instance Method Summary collapse

Methods inherited from PrawnHtml::Tag

#block_styles, class_for, #initialize, #process_styles, #tag_close_styles, #tag_open_styles

Constructor Details

This class inherits a constructor from PrawnHtml::Tag

Instance Method Details

#block?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/prawn_html/tags/pre.rb', line 11

def block?
  true
end

#tag_stylesObject



15
16
17
18
19
20
21
22
# File 'lib/prawn_html/tags/pre.rb', line 15

def tag_styles
  <<~STYLES
    font-family: Courier;
    margin-bottom: #{MARGIN_BOTTOM}px;
    margin-top: #{MARGIN_TOP}px;
    white-space: pre;
  STYLES
end