Class: OpenXml::Pptx::Parts::Image
- Inherits:
-
OpenXml::Parts::UnparsedPart
- Object
- OpenXml::Parts::UnparsedPart
- OpenXml::Pptx::Parts::Image
- Defined in:
- lib/openxml/pptx/parts/image.rb
Constant Summary collapse
- IMAGE_RELATIONSHIP_TYPE =
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image".freeze
- IMAGE_TYPES =
{ ".jpeg" => "image/jpeg", ".jpg" => "image/jpeg", ".png" => "image/png", ".gif" => "image/gif", ".bmp" => "image/bmp", ".tiff" => "image/tiff", ".jxr" => "image/vnd.ms-photo" }.freeze
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#path ⇒ Object
Returns the value of attribute path.
-
#relationship_type ⇒ Object
readonly
Returns the value of attribute relationship_type.
Instance Method Summary collapse
-
#initialize(*args, extension: ".png") ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(*args, extension: ".png") ⇒ Image
Returns a new instance of Image.
7 8 9 10 11 12 |
# File 'lib/openxml/pptx/parts/image.rb', line 7 def initialize(*args, extension: ".png") super(*args) @path = Pathname.new("ppt/media/image#{extension}") @content_type = IMAGE_TYPES.fetch(extension) @relationship_type = IMAGE_RELATIONSHIP_TYPE end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/openxml/pptx/parts/image.rb', line 5 def content_type @content_type end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/openxml/pptx/parts/image.rb', line 5 def path @path end |
#relationship_type ⇒ Object (readonly)
Returns the value of attribute relationship_type.
5 6 7 |
# File 'lib/openxml/pptx/parts/image.rb', line 5 def relationship_type @relationship_type end |