Module: Rfcxml::V3::Td::ColspanRowspanNormalizer

Included in:
Rfcxml::V3::Td
Defined in:
lib/rfcxml/v3/td.rb

Overview

Normalize empty string colspan/rowspan to nil. Schema default for colspan/rowspan is “1”, so empty string should not be serialized as an attribute. This ensures round-trip comparison treats rowspan=“” (in source) as equivalent to absent rowspan.

Instance Method Summary collapse

Instance Method Details

#colspan=(value) ⇒ Object



20
21
22
# File 'lib/rfcxml/v3/td.rb', line 20

def colspan=(value)
  super(value.to_s.empty? ? nil : value)
end

#rowspan=(value) ⇒ Object



24
25
26
# File 'lib/rfcxml/v3/td.rb', line 24

def rowspan=(value)
  super(value.to_s.empty? ? nil : value)
end