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

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

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

Returns a new instance of Tile.



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

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

Instance Attribute Details

#alignObject

Returns the value of attribute align.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 4

def align
  @align
end

#flipObject

Returns the value of attribute flip.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 4

def flip
  @flip
end

#offsetObject

Returns the value of attribute offset.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 4

def offset
  @offset
end

#ratioObject

Returns the value of attribute ratio.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 4

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



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

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