Class: OoxmlParser::Tile
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Tile
- Defined in:
- lib/ooxml_parser/common_parser/common_data/colors/tile.rb
Constant Summary
Constants inherited from OOXMLDocumentObject
OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA
Instance Attribute Summary collapse
-
#align ⇒ Object
Returns the value of attribute align.
-
#flip ⇒ Object
Returns the value of attribute flip.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#ratio ⇒ Object
Returns the value of attribute ratio.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(offset = nil, ratio = nil) ⇒ Tile
constructor
A new instance of Tile.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, copy_media_file, current_xml, dir, encrypted_file?, get_link_from_rels, media_folder, option_enabled?, unzip_file
Constructor Details
#initialize(offset = nil, ratio = nil) ⇒ Tile
Returns a new instance of Tile.
5 6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 5 def initialize(offset = nil, ratio = nil) @offset = offset @ratio = ratio end |
Instance Attribute Details
#align ⇒ Object
Returns the value of attribute align.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 3 def align @align end |
#flip ⇒ Object
Returns the value of attribute flip.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 3 def flip @flip end |
#offset ⇒ Object
Returns the value of attribute offset.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 3 def offset @offset end |
#ratio ⇒ Object
Returns the value of attribute ratio.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 3 def ratio @ratio end |
Class Method Details
.parse(tile_node) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/tile.rb', line 10 def self.parse(tile_node) tile = Tile.new(OOXMLShift.parse(tile_node, 'tx', 'ty'), OOXMLShift.parse(tile_node, 'sx', 'sy')) tile_node.attributes.each do |key, value| case key when 'algn' tile.align = Alignment.parse(value) end end tile end |