Class: OoxmlParser::Tile

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/colors/tile.rb

Overview

Class for parsing ‘tile` tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(offset = nil, ratio = nil, parent: nil) ⇒ Tile

Returns a new instance of Tile.



8
9
10
11
12
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 8

def initialize(offset = nil, ratio = nil, parent: nil)
  @offset = offset
  @ratio = ratio
  super(parent: parent)
end

Instance Attribute Details

#alignObject

Returns the value of attribute align.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 6

def align
  @align
end

#flipObject

Returns the value of attribute flip.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 6

def flip
  @flip
end

#offsetObject

Returns the value of attribute offset.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 6

def offset
  @offset
end

#ratioObject

Returns the value of attribute ratio.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 6

def ratio
  @ratio
end

Instance Method Details

#parse(node) ⇒ Tile

Parse Tile object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:

  • (Tile)

    result of parsing



17
18
19
20
21
22
23
24
25
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 17

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'algn'
      @align = value_to_symbol(value)
    end
  end
  self
end