Class: Powerpoint::Slide::Pictorial

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util

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

Constructor Details

#initialize(options = {}) ⇒ Pictorial

Returns a new instance of Pictorial.



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

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

Instance Attribute Details

#coordsObject (readonly)

Returns the value of attribute coords.



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

def coords
  @coords
end

#image_nameObject (readonly)

Returns the value of attribute image_name.



11
12
13
# File 'lib/powerpoint/slide/pictorial.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/pictorial.rb', line 11

def image_path
  @image_path
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#file_typeObject



26
27
28
# File 'lib/powerpoint/slide/pictorial.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/pictorial.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