Class: EBPS::Text::Picture
Constant Summary
Constants inherited from String
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#height_goal ⇒ Object
Returns the value of attribute height_goal.
-
#width ⇒ Object
Returns the value of attribute width.
-
#width_goal ⇒ Object
Returns the value of attribute width_goal.
-
#xscale ⇒ Object
Returns the value of attribute xscale.
-
#yscale ⇒ Object
Returns the value of attribute yscale.
Instance Method Summary collapse
- #digest ⇒ Object
- #empty? ⇒ Boolean
- #filename ⇒ Object
- #formats ⇒ Object
- #image ⇒ Object
-
#initialize ⇒ Picture
constructor
A new instance of Picture.
- #set_format(*ignore) ⇒ Object
-
#to_s ⇒ Object
ignore.
Methods inherited from String
Constructor Details
#initialize ⇒ Picture
Returns a new instance of Picture.
10 11 12 |
# File 'lib/ebps/text/picture.rb', line 10 def initialize super('') end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
9 10 11 |
# File 'lib/ebps/text/picture.rb', line 9 def height @height end |
#height_goal ⇒ Object
Returns the value of attribute height_goal.
9 10 11 |
# File 'lib/ebps/text/picture.rb', line 9 def height_goal @height_goal end |
#width ⇒ Object
Returns the value of attribute width.
9 10 11 |
# File 'lib/ebps/text/picture.rb', line 9 def width @width end |
#width_goal ⇒ Object
Returns the value of attribute width_goal.
9 10 11 |
# File 'lib/ebps/text/picture.rb', line 9 def width_goal @width_goal end |
#xscale ⇒ Object
Returns the value of attribute xscale.
9 10 11 |
# File 'lib/ebps/text/picture.rb', line 9 def xscale @xscale end |
#yscale ⇒ Object
Returns the value of attribute yscale.
9 10 11 |
# File 'lib/ebps/text/picture.rb', line 9 def yscale @yscale end |
Instance Method Details
#digest ⇒ Object
13 14 15 |
# File 'lib/ebps/text/picture.rb', line 13 def digest @digest ||= Digest::MD5.hexdigest(self) end |
#empty? ⇒ Boolean
16 17 18 19 20 21 22 23 |
# File 'lib/ebps/text/picture.rb', line 16 def empty? super rescue StandardError => err EBPS.logger.error("Text::Picture") { sprintf "%s: %s", err.class, err. } true end |
#filename ⇒ Object
24 25 26 |
# File 'lib/ebps/text/picture.rb', line 24 def filename @filename ||= "%s.%s" % [digest, EBPS.config.image_format] end |
#formats ⇒ Object
27 28 29 |
# File 'lib/ebps/text/picture.rb', line 27 def formats [] end |
#image ⇒ Object
30 31 32 |
# File 'lib/ebps/text/picture.rb', line 30 def image Magick::Image.from_blob(self).first end |
#set_format(*ignore) ⇒ Object
33 34 35 |
# File 'lib/ebps/text/picture.rb', line 33 def set_format(*ignore) # ignore end |
#to_s ⇒ Object
ignore
36 37 38 |
# File 'lib/ebps/text/picture.rb', line 36 def to_s image.inspect end |