Class: Shapefile::Shape::Point
- Inherits:
-
Shapefile::Shape
- Object
- Shapefile::Shape
- Shapefile::Shape::Point
- Defined in:
- lib/shapefile/shape/point.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Attributes inherited from Shapefile::Shape
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(nbr, record) ⇒ Point
constructor
A new instance of Point.
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
#x ⇒ Object (readonly)
Returns the value of attribute x.
2 3 4 |
# File 'lib/shapefile/shape/point.rb', line 2 def x @x end |
#y ⇒ Object (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
.code ⇒ Object
4 |
# File 'lib/shapefile/shape/point.rb', line 4 def self.code; 1 end |