Class: Powerpoint::Slide::Custom
- Inherits:
-
Object
- Object
- Powerpoint::Slide::Custom
- Includes:
- Util
- Defined in:
- lib/powerpoint/slide/custom.rb
Instance Attribute Summary collapse
-
#coords ⇒ Object
readonly
Returns the value of attribute coords.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#subtitle ⇒ Object
readonly
Returns the value of attribute subtitle.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #file_type ⇒ Object
-
#initialize(options = {}) ⇒ Custom
constructor
A new instance of Custom.
- #save(extract_path, index) ⇒ Object
Methods included from Util
#copy_media, #merge_variables, #pixle_to_pt, #read_template, #render_view, #require_arguments
Constructor Details
#initialize(options = {}) ⇒ Custom
Returns a new instance of Custom.
13 14 15 16 17 18 |
# File 'lib/powerpoint/slide/custom.rb', line 13 def initialize(={}) require_arguments [:title, :properties], .each {|k, v| instance_variable_set("@#{k}", v)} @coords = default_coords unless @coords.present? properties end |
Instance Attribute Details
#coords ⇒ Object (readonly)
Returns the value of attribute coords.
11 12 13 |
# File 'lib/powerpoint/slide/custom.rb', line 11 def coords @coords end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
11 12 13 |
# File 'lib/powerpoint/slide/custom.rb', line 11 def properties @properties end |
#subtitle ⇒ Object (readonly)
Returns the value of attribute subtitle.
11 12 13 |
# File 'lib/powerpoint/slide/custom.rb', line 11 def subtitle @subtitle end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
11 12 13 |
# File 'lib/powerpoint/slide/custom.rb', line 11 def title @title end |
Instance Method Details
#file_type ⇒ Object
30 31 32 |
# File 'lib/powerpoint/slide/custom.rb', line 30 def file_type File.extname(image_name).gsub('.', '') end |
#save(extract_path, index) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/powerpoint/slide/custom.rb', line 20 def save(extract_path, index) properties.each do |property| if property[:type] == 'image' copy_media(extract_path, property[:file_path]) end end save_rel_xml(extract_path, index) (extract_path, index) end |