Class: Nokogiri::XML::Element
- Inherits:
-
Object
- Object
- Nokogiri::XML::Element
- Defined in:
- lib/nokogiri/xml/element.rb
Constant Summary collapse
- DEFAULT_FONT_SIZE =
12.to_f
Instance Method Summary collapse
- #bold? ⇒ Boolean
-
#font_size ⇒ Object
The node’s font size Used for guessing heading sizes.
- #italic? ⇒ Boolean
Instance Method Details
#bold? ⇒ Boolean
15 16 17 |
# File 'lib/nokogiri/xml/element.rb', line 15 def bold? styles['font-weight'] && styles['font-weight'] == "bold" end |
#font_size ⇒ Object
The node’s font size Used for guessing heading sizes
Returns a float with the font-size
11 12 13 |
# File 'lib/nokogiri/xml/element.rb', line 11 def font_size styles['font-size'] ? styles['font-size'].to_f : DEFAULT_FONT_SIZE end |
#italic? ⇒ Boolean
19 20 21 |
# File 'lib/nokogiri/xml/element.rb', line 19 def italic? styles['font-style'] && styles['font-style'] == "italic" end |