Class: OoxmlParser::ImageFill
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ImageFill
- Defined in:
- lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
Instance Attribute Summary collapse
-
#file_reference ⇒ FileReference
Image structure.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#stretch ⇒ Object
Returns the value of attribute stretch.
-
#tile ⇒ Object
Returns the value of attribute tile.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ ImageFill
constructor
A new instance of ImageFill.
-
#parse(node) ⇒ ImageFill
Parse ImageFill object.
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
Constructor Details
#initialize(parent: nil) ⇒ ImageFill
Returns a new instance of ImageFill.
8 9 10 11 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb', line 8 def initialize(parent: nil) @path = '' @parent = parent end |
Instance Attribute Details
#file_reference ⇒ FileReference
Returns image structure.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb', line 6 def file_reference @file_reference end |
#properties ⇒ Object
Returns the value of attribute properties.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb', line 4 def properties @properties end |
#stretch ⇒ Object
Returns the value of attribute stretch.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb', line 4 def stretch @stretch end |
#tile ⇒ Object
Returns the value of attribute tile.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb', line 4 def tile @tile end |
Instance Method Details
#parse(node) ⇒ ImageFill
Parse ImageFill object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb', line 16 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'blip' @file_reference = FileReference.new(parent: self).parse(node_child) when 'tile' @tile = Tile.new(OOXMLCoordinates.parse(node_child, x_attr: 'tx', y_attr: 'ty'), OOXMLCoordinates.parse(node_child, x_attr: 'sx', y_attr: 'sy'), parent: self).parse(node_child) end end self end |