class OoxmlParser::CheckBox

Class for parsing ‘checkbox` tag

Attributes

checked[R]

@return [True, False] specifies if checkbox is checked

checked_state[R]

@return [CheckBoxState] options of checked state

group_key[R]

@return [ValuedChild] group key

unchecked_state[R]

@return [CheckBoxState] options of unchecked state

Public Instance Methods

parse(node) click to toggle source

Parse CheckBox object @param node [Nokogiri::XML:Element] node to parse @return [CheckBox] result of parsing

# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/checkbox.rb, line 19
def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'checked'
      @checked = option_enabled?(node_child, 'hidden')
    when 'checkedState'
      @checked_state = CheckBoxState.new(parent: self).parse(node_child)
    when 'uncheckedState'
      @unchecked_state = CheckBoxState.new(parent: self).parse(node_child)
    when 'groupKey'
      @group_key = ValuedChild.new(:string, parent: self).parse(node_child)
    end
  end
  self
end