Class: Nokogiri::XML::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/nokogiri/xml/element.rb

Instance Method Summary collapse

Instance Method Details

#bold?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/nokogiri/xml/element.rb', line 13

def bold?
  styles['font-weight'] && styles['font-weight'] == "bold"
end

#font_sizeObject

The node’s font size Used for guessing heading sizes

Returns a float with the font-size



9
10
11
# File 'lib/nokogiri/xml/element.rb', line 9

def font_size
  styles['font-size'].to_f if styles['font-size']
end

#italic?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/nokogiri/xml/element.rb', line 17

def italic?
  styles['font-style'] && styles['font-style'] == "italic"
end