Class: Goldendocx::Components::Image
- Inherits:
-
Object
- Object
- Goldendocx::Components::Image
- Includes:
- Element
- Defined in:
- lib/goldendocx/components/image.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#height ⇒ Object
Returns the value of attribute height.
-
#relationship_id ⇒ Object
Returns the value of attribute relationship_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(type: :shape, **attributes) ⇒ Image
constructor
A new instance of Image.
Methods included from Element
#build_element, #namespace, #tag, #tag_name, #to_element, #to_xml
Methods included from HasChildren
#children, #read_child, #read_children
Methods included from HasAttributes
#assign_attributes, #attributes, #read_attributes
Constructor Details
#initialize(type: :shape, **attributes) ⇒ Image
Returns a new instance of Image.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/goldendocx/components/image.rb', line 18 def initialize(type: :shape, **attributes) @type = type @container = build_run case type when :picture inline_drawing = @container.build_drawing.build_inline inline_drawing.build_non_visual_property inline_drawing.build_extents inline_drawing.build_graphic.build_data.build_picture else @container.build_shape end attributes.each do |name, value| send("#{name}=", value) if respond_to?("#{name}=") end end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
16 17 18 |
# File 'lib/goldendocx/components/image.rb', line 16 def container @container end |
#height ⇒ Object
Returns the value of attribute height.
16 17 18 |
# File 'lib/goldendocx/components/image.rb', line 16 def height @height end |
#relationship_id ⇒ Object
Returns the value of attribute relationship_id.
16 17 18 |
# File 'lib/goldendocx/components/image.rb', line 16 def relationship_id @relationship_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/goldendocx/components/image.rb', line 16 def type @type end |
#width ⇒ Object
Returns the value of attribute width.
16 17 18 |
# File 'lib/goldendocx/components/image.rb', line 16 def width @width end |