Class: Powerpoint::Slide::DescriptionPic

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/powerpoint/slide/picture_description.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util

#copy_media, #pixle_to_pt, #read_template, #render_view, #require_arguments

Constructor Details

#initialize(options = {}) ⇒ DescriptionPic

Returns a new instance of DescriptionPic.



13
14
15
16
17
18
# File 'lib/powerpoint/slide/picture_description.rb', line 13

def initialize(options={})
  require_arguments [:presentation, :title, :image_path, :content], options
  options.each {|k, v| instance_variable_set("@#{k}", v)}
  @coords = default_coords
  @image_name = File.basename(@image_path)
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



11
12
13
# File 'lib/powerpoint/slide/picture_description.rb', line 11

def content
  @content
end

#coordsObject (readonly)

Returns the value of attribute coords.



11
12
13
# File 'lib/powerpoint/slide/picture_description.rb', line 11

def coords
  @coords
end

#image_nameObject (readonly)

Returns the value of attribute image_name.



11
12
13
# File 'lib/powerpoint/slide/picture_description.rb', line 11

def image_name
  @image_name
end

#image_pathObject (readonly)

Returns the value of attribute image_path.



11
12
13
# File 'lib/powerpoint/slide/picture_description.rb', line 11

def image_path
  @image_path
end

#titleObject (readonly)

Returns the value of attribute title.



11
12
13
# File 'lib/powerpoint/slide/picture_description.rb', line 11

def title
  @title
end

Instance Method Details

#file_typeObject



26
27
28
# File 'lib/powerpoint/slide/picture_description.rb', line 26

def file_type
  File.extname(image_name).gsub('.', '')
end

#save(extract_path, index) ⇒ Object



20
21
22
23
24
# File 'lib/powerpoint/slide/picture_description.rb', line 20

def save(extract_path, index)
  copy_media(extract_path, @image_path)
  save_rel_xml(extract_path, index)
  save_slide_xml(extract_path, index)
end