Class: Poppler::Rectangle
- Inherits:
-
Object
- Object
- Poppler::Rectangle
- Defined in:
- lib/poppler/rectangle.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Rectangle
constructor
A new instance of Rectangle.
- #initialize_raw ⇒ Object
- #inspect ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(*args) ⇒ Rectangle
Returns a new instance of Rectangle.
20 21 22 23 24 25 26 27 28 |
# File 'lib/poppler/rectangle.rb', line 20 def initialize(*args) super() return if args.empty? self.x1 = args[0] self.y1 = args[1] self.x2 = args[2] self.y2 = args[3] end |
Instance Method Details
#initialize_raw ⇒ Object
19 |
# File 'lib/poppler/rectangle.rb', line 19 alias_method :initialize_raw, :initialize |
#inspect ⇒ Object
34 35 36 37 38 |
# File 'lib/poppler/rectangle.rb', line 34 def inspect super.gsub(/>\z/) do ": [%g, %g, %g, %g]>" % to_a end end |
#to_a ⇒ Object
30 31 32 |
# File 'lib/poppler/rectangle.rb', line 30 def to_a [x1, y1, x2, y2] end |