Class: Shapefile::Shape::Point

Inherits:
Shapefile::Shape show all
Defined in:
lib/shapefile/shape/point.rb

Direct Known Subclasses

PointM

Instance Attribute Summary collapse

Attributes inherited from Shapefile::Shape

#attributes, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Shapefile::Shape

#[], class_for_code, enumerate_subclass_codes

Constructor Details

#initialize(nbr, record) ⇒ Point

Returns a new instance of Point.



6
7
8
9
# File 'lib/shapefile/shape/point.rb', line 6

def initialize(nbr, record)
  super
  @x, @y = record.unpack("EE")
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



2
3
4
# File 'lib/shapefile/shape/point.rb', line 2

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



2
3
4
# File 'lib/shapefile/shape/point.rb', line 2

def y
  @y
end

Class Method Details

.codeObject



4
# File 'lib/shapefile/shape/point.rb', line 4

def self.code; 1 end