Class: EsriShapefile::Shapes::Point

Inherits:
Object
  • Object
show all
Includes:
ByteModel
Defined in:
lib/esri_shapefile/models/shapes/point.rb

Overview

A point consists of a pair of double-precision coordinates in the order X,Y.

Instance Attribute Summary

Attributes included from ByteModel

#metadata

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ByteModel

extended, included

Class Method Details

.at(x:, y:) ⇒ Object



16
17
18
19
20
21
# File 'lib/esri_shapefile/models/shapes/point.rb', line 16

def self.at(x:, y:)
  point = Point.new
  point.x = x
  point.y = y
  point
end

Instance Method Details

#eql?(point) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


23
24
25
# File 'lib/esri_shapefile/models/shapes/point.rb', line 23

def eql?(point)
  point.is_a?(Point) && point.x == x && point.y == y
end