Class: PDF::Wrapper::TextImageCell
- Inherits:
-
Object
- Object
- PDF::Wrapper::TextImageCell
- Defined in:
- lib/pdf/wrapper/text_image_cell.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#max_width ⇒ Object
readonly
Returns the value of attribute max_width.
-
#min_width ⇒ Object
readonly
Returns the value of attribute min_width.
-
#natural_width ⇒ Object
readonly
Returns the value of attribute natural_width.
- #options ⇒ Object
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#width ⇒ Object
Returns the value of attribute width.
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Instance Method Summary collapse
- #calculate_height(wrapper) ⇒ Object
- #calculate_width_range(wrapper) ⇒ Object
- #draw(wrapper, x, y) ⇒ Object
-
#initialize(str, filename, width, height) ⇒ TextImageCell
constructor
A new instance of TextImageCell.
Constructor Details
#initialize(str, filename, width, height) ⇒ TextImageCell
Returns a new instance of TextImageCell.
11 12 13 14 15 16 17 18 19 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 11 def initialize(str, filename, width, height) @text = str.to_s @filename = filename @min_width = width @natural_width = width @max_width = width @height = height @options = {} end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
8 9 10 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 8 def height @height end |
#max_width ⇒ Object (readonly)
Returns the value of attribute max_width.
7 8 9 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7 def max_width @max_width end |
#min_width ⇒ Object (readonly)
Returns the value of attribute min_width.
7 8 9 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7 def min_width @min_width end |
#natural_width ⇒ Object (readonly)
Returns the value of attribute natural_width.
7 8 9 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7 def natural_width @natural_width end |
#options ⇒ Object
36 37 38 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 36 def @options ||= {} end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
7 8 9 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7 def text @text end |
#width ⇒ Object
Returns the value of attribute width.
8 9 10 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 8 def width @width end |
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
7 8 9 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 7 def wrapper @wrapper end |
Instance Method Details
#calculate_height(wrapper) ⇒ Object
32 33 34 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 32 def calculate_height(wrapper) # nothing required, height set in constructor end |
#calculate_width_range(wrapper) ⇒ Object
28 29 30 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 28 def calculate_width_range(wrapper) # nothing required, width range set in constructor end |
#draw(wrapper, x, y) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/pdf/wrapper/text_image_cell.rb', line 21 def draw(wrapper, x, y) @wrapper = wrapper wrapper.cell(self.text, x, y, self.width, self.height, self.) wrapper.image(@filename, (x,y)) end |