Class: Odf::Element::Image
- Defined in:
- lib/odf/element/image.rb
Constant Summary collapse
- VALID_OPTIONS =
{ filter_name: 'draw:filter-name', actuate: 'xlink:actuate', href: 'xlink:href', show: 'xlink:show', type: 'xlink:type', xml_id: 'xml:id' }
- XML_TAG =
'draw:image'.freeze
Instance Attribute Summary
Attributes inherited from Abstract
Class Method Summary collapse
Instance Method Summary collapse
- #add_paragraph(text, options = {}) ⇒ Object
-
#initialize(parent, options) ⇒ Image
constructor
A new instance of Image.
Methods inherited from Abstract
#document, #valid_options, #xml_tag
Constructor Details
#initialize(parent, options) ⇒ Image
Returns a new instance of Image.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/odf/element/image.rb', line 19 def initialize(parent, ) @parent = parent # Save image under Pictures directory if .fetch(:save, true) && [:href] uri = save_image([:href]) .merge!({ href: uri, show: 'embed' }) end super(parent, ) end |
Class Method Details
.build(parent, options = {}) ⇒ Object
15 16 17 |
# File 'lib/odf/element/image.rb', line 15 def self.build(parent, = {}) new(parent, ) end |