Sha256: f7f4203adc50d40c342012778e301eed869e971dc46cc4746b1bb89d650a3dd4

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module Goldendocx
  module Tables
    class ImageCell < Cell
      embeds_one :image, class_name: 'Goldendocx::Components::Image'

      def image=(image)
        build_image(
          relationship_id: image.relationship_id,
          width: image.width,
          height: image.height
        )
      end

      def content=(content)
        return unless content

        image.build_run.build_text.value = content
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
goldendocx-0.3.0 lib/goldendocx/tables/image_cell.rb
goldendocx-0.2.3 lib/goldendocx/tables/image_cell.rb
goldendocx-0.2.2 lib/goldendocx/tables/image_cell.rb