Sha256: d8e8ff8ccaeb19decffa077f73302dc88c6746b8c132c1c99047302176ee3bea
Contents?: true
Size: 1.29 KB
Versions: 2
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true module Goldendocx module Images class Picture include Goldendocx::Element namespace :pic tag :pic embeds_one :non_visual_picture, class_name: 'Goldendocx::Images::Properties::NonVisualPictureProperty', auto_build: true embeds_one :drawing, class_name: 'Goldendocx::Images::Properties::DrawingProperty', auto_build: true embeds_one :picture_fill, class_name: 'Goldendocx::Images::Properties::PictureFillProperty', auto_build: true embeds_one :picture_shape, class_name: 'Goldendocx::Images::Properties::PictureShapeProperty', auto_build: true def initialize(**attributes) attributes.each do |name, value| send("#{name}=", value) if respond_to?("#{name}=") end end def width=(width) picture_shape.transform.extents.width = width if width end def height=(height) picture_shape.transform.extents.height = height if height end def relationship_id=(relationship_id) return unless relationship_id non_visual_picture.non_visual_drawing.assign_attributes( relationship_id: relationship_id, name: "#{relationship_id}.png" ) picture_fill.blip.relationship_id = relationship_id end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
goldendocx-0.2.3 | lib/goldendocx/images/picture.rb |
goldendocx-0.2.2 | lib/goldendocx/images/picture.rb |