Sha256: f0d510c4ec42f50285ed09998676bf34698541dd945632aacd0a5a2aa335bb2e
Contents?: true
Size: 1.01 KB
Versions: 2
Compression:
Stored size: 1.01 KB
Contents
# Style Parameter Data module OoxmlParser class StyleParametres attr_accessor :q_format, :hidden, :name def initialize(name = nil, q_format = false, hidden = false) @name = name @q_format = q_format @hidden = hidden end def ==(other) all_instance_variables = instance_variables all_instance_variables.each do |current_attributes| unless instance_variable_get(current_attributes) == other.instance_variable_get(current_attributes) return false end end true end def self.parse(style_tag) style = StyleParametres.new style_tag.xpath('w:name').each do |name| style.name = name.attribute('val').value end style_tag.xpath('w:qFormat').each do |q_format| next if q_format.attribute('val').nil? next if q_format.attribute('val').value == false || q_format.attribute('val').value == 'off' || q_format.attribute('val').value == '0' style.q_format = true end style end end end
Version data entries
2 entries across 2 versions & 1 rubygems