Class: PDF::Reader::Point
- Inherits:
-
Object
- Object
- PDF::Reader::Point
- Defined in:
- lib/pdf/reader/point.rb
Overview
PDFs are all about positioning content on a page, so there’s lots of need to work with a set of X,Y coordinates.
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(x, y) ⇒ Point
constructor
A new instance of Point.
Constructor Details
#initialize(x, y) ⇒ Point
Returns a new instance of Point.
15 16 17 |
# File 'lib/pdf/reader/point.rb', line 15 def initialize(x, y) @x, @y = x, y end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
13 14 15 |
# File 'lib/pdf/reader/point.rb', line 13 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
13 14 15 |
# File 'lib/pdf/reader/point.rb', line 13 def y @y end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/pdf/reader/point.rb', line 19 def ==(other) other.respond_to?(:x) && other.respond_to?(:y) && x == other.x && y == other.y end |