Class: SimpleMapnik::Coordinate
- Inherits:
-
Object
- Object
- SimpleMapnik::Coordinate
- Includes:
- FFI
- Defined in:
- lib/simple_mapnik/coordinate.rb
Constant Summary
Constants included from FFI
Instance Attribute Summary collapse
-
#ptr ⇒ Object
Returns the value of attribute ptr.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y) ⇒ Coordinate
constructor
A new instance of Coordinate.
Methods included from FFI
attach_functions, find_lib, mapnik_c_api_path
Constructor Details
#initialize(x, y) ⇒ Coordinate
Returns a new instance of Coordinate.
7 8 9 10 11 12 13 14 |
# File 'lib/simple_mapnik/coordinate.rb', line 7 def initialize(x, y) @x = x @y = y coord_struct = MAPNIK_COORD_T.new coord_struct[:x] = x coord_struct[:y] = y @ptr = coord_struct.to_ptr end |
Instance Attribute Details
#ptr ⇒ Object
Returns the value of attribute ptr.
5 6 7 |
# File 'lib/simple_mapnik/coordinate.rb', line 5 def ptr @ptr end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/simple_mapnik/coordinate.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/simple_mapnik/coordinate.rb', line 5 def y @y end |