Class: Poppler::Rectangle

Inherits:
Object
  • Object
show all
Defined in:
lib/poppler/rectangle.rb

Instance Method Summary collapse

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_rawObject



19
# File 'lib/poppler/rectangle.rb', line 19

alias_method :initialize_raw, :initialize

#inspectObject



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_aObject



30
31
32
# File 'lib/poppler/rectangle.rb', line 30

def to_a
  [x1, y1, x2, y2]
end