Class: Writexlsx::Image
- Inherits:
-
Object
- Object
- Writexlsx::Image
- Defined in:
- lib/write_xlsx/image.rb
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#decorative ⇒ Object
readonly
Returns the value of attribute decorative.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#tip ⇒ Object
readonly
Returns the value of attribute tip.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#x_offset ⇒ Object
readonly
Returns the value of attribute x_offset.
-
#x_scale ⇒ Object
readonly
Returns the value of attribute x_scale.
-
#y_offset ⇒ Object
readonly
Returns the value of attribute y_offset.
-
#y_scale ⇒ Object
readonly
Returns the value of attribute y_scale.
Instance Method Summary collapse
- #filename ⇒ Object
- #height ⇒ Object
- #height_emus ⇒ Object
- #image ⇒ Object
-
#initialize(row, col, image, x_offset, y_offset, x_scale, y_scale, url, tip, anchor, description, decorative) ⇒ Image
constructor
A new instance of Image.
- #md5 ⇒ Object
- #name ⇒ Object
- #position ⇒ Object
- #ref_id ⇒ Object
- #scaled_height ⇒ Object
- #scaled_width ⇒ Object
- #type ⇒ Object
- #width ⇒ Object
- #width_emus ⇒ Object
- #x_dpi ⇒ Object
- #y_dpi ⇒ Object
Constructor Details
#initialize(row, col, image, x_offset, y_offset, x_scale, y_scale, url, tip, anchor, description, decorative) ⇒ Image
Returns a new instance of Image.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/write_xlsx/image.rb', line 11 def initialize( row, col, image, x_offset, y_offset, x_scale, y_scale, url, tip, anchor, description, decorative ) @row = row @col = col @image = ImageProperty.new(image) @x_offset = x_offset @y_offset = y_offset @x_scale = x_scale @y_scale = y_scale @url = url @tip = tip @anchor = anchor @description = description @decorative = decorative end |
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor.
9 10 11 |
# File 'lib/write_xlsx/image.rb', line 9 def anchor @anchor end |
#col ⇒ Object (readonly)
Returns the value of attribute col.
8 9 10 |
# File 'lib/write_xlsx/image.rb', line 8 def col @col end |
#decorative ⇒ Object (readonly)
Returns the value of attribute decorative.
9 10 11 |
# File 'lib/write_xlsx/image.rb', line 9 def decorative @decorative end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/write_xlsx/image.rb', line 9 def description @description end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
8 9 10 |
# File 'lib/write_xlsx/image.rb', line 8 def row @row end |
#tip ⇒ Object (readonly)
Returns the value of attribute tip.
9 10 11 |
# File 'lib/write_xlsx/image.rb', line 9 def tip @tip end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/write_xlsx/image.rb', line 9 def url @url end |
#x_offset ⇒ Object (readonly)
Returns the value of attribute x_offset.
8 9 10 |
# File 'lib/write_xlsx/image.rb', line 8 def x_offset @x_offset end |
#x_scale ⇒ Object (readonly)
Returns the value of attribute x_scale.
8 9 10 |
# File 'lib/write_xlsx/image.rb', line 8 def x_scale @x_scale end |
#y_offset ⇒ Object (readonly)
Returns the value of attribute y_offset.
8 9 10 |
# File 'lib/write_xlsx/image.rb', line 8 def y_offset @y_offset end |
#y_scale ⇒ Object (readonly)
Returns the value of attribute y_scale.
8 9 10 |
# File 'lib/write_xlsx/image.rb', line 8 def y_scale @y_scale end |
Instance Method Details
#filename ⇒ Object
77 78 79 |
# File 'lib/write_xlsx/image.rb', line 77 def filename @image.filename end |
#height ⇒ Object
57 58 59 |
# File 'lib/write_xlsx/image.rb', line 57 def height @image.height end |
#height_emus ⇒ Object
41 42 43 |
# File 'lib/write_xlsx/image.rb', line 41 def height_emus (0.5 + (scaled_height * 9_525)).to_i end |
#image ⇒ Object
45 46 47 |
# File 'lib/write_xlsx/image.rb', line 45 def image @image.filename end |
#md5 ⇒ Object
73 74 75 |
# File 'lib/write_xlsx/image.rb', line 73 def md5 @image.md5 end |
#name ⇒ Object
61 62 63 |
# File 'lib/write_xlsx/image.rb', line 61 def name @image.name end |
#position ⇒ Object
81 82 83 |
# File 'lib/write_xlsx/image.rb', line 81 def position @image.position end |
#ref_id ⇒ Object
85 86 87 |
# File 'lib/write_xlsx/image.rb', line 85 def ref_id @image.ref_id end |
#scaled_height ⇒ Object
33 34 35 |
# File 'lib/write_xlsx/image.rb', line 33 def scaled_height height * y_scale * 96.0 / y_dpi end |
#scaled_width ⇒ Object
29 30 31 |
# File 'lib/write_xlsx/image.rb', line 29 def scaled_width width * x_scale * 96.0 / x_dpi end |
#type ⇒ Object
49 50 51 |
# File 'lib/write_xlsx/image.rb', line 49 def type @image.type end |
#width ⇒ Object
53 54 55 |
# File 'lib/write_xlsx/image.rb', line 53 def width @image.width end |
#width_emus ⇒ Object
37 38 39 |
# File 'lib/write_xlsx/image.rb', line 37 def width_emus (0.5 + (scaled_width * 9_525)).to_i end |
#x_dpi ⇒ Object
65 66 67 |
# File 'lib/write_xlsx/image.rb', line 65 def x_dpi @image.x_dpi end |
#y_dpi ⇒ Object
69 70 71 |
# File 'lib/write_xlsx/image.rb', line 69 def y_dpi @image.y_dpi end |