Class: SimpleMapnik::Coordinate

Inherits:
Object
  • Object
show all
Includes:
FFI
Defined in:
lib/simple_mapnik/coordinate.rb

Constant Summary

Constants included from FFI

FFI::MAPNIK_FUNCTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ptrObject

Returns the value of attribute ptr.



5
6
7
# File 'lib/simple_mapnik/coordinate.rb', line 5

def ptr
  @ptr
end

#xObject

Returns the value of attribute x.



5
6
7
# File 'lib/simple_mapnik/coordinate.rb', line 5

def x
  @x
end

#yObject

Returns the value of attribute y.



5
6
7
# File 'lib/simple_mapnik/coordinate.rb', line 5

def y
  @y
end