Class: Geos::Handle
- Inherits:
-
Object
- Object
- Geos::Handle
- Defined in:
- lib/ffi-geos.rb
Instance Attribute Summary collapse
-
#ptr ⇒ Object
readonly
Returns the value of attribute ptr.
Class Method Summary collapse
Instance Method Summary collapse
- #error_handler(*args) ⇒ Object
-
#initialize ⇒ Handle
constructor
A new instance of Handle.
- #notice_handler(*args) ⇒ Object
Constructor Details
#initialize ⇒ Handle
Returns a new instance of Handle.
977 978 979 980 981 982 983 984 985 |
# File 'lib/ffi-geos.rb', line 977 def initialize @ptr = FFI::AutoPointer.new( FFIGeos.initGEOS_r( @notice_handler = self.method(:notice_handler), @error_handler = self.method(:error_handler) ), self.class.method(:release) ) end |
Instance Attribute Details
#ptr ⇒ Object (readonly)
Returns the value of attribute ptr.
975 976 977 |
# File 'lib/ffi-geos.rb', line 975 def ptr @ptr end |
Class Method Details
.release(ptr) ⇒ Object
987 988 989 |
# File 'lib/ffi-geos.rb', line 987 def self.release(ptr) FFIGeos.finishGEOS_r(ptr) end |
Instance Method Details
#error_handler(*args) ⇒ Object
995 996 997 |
# File 'lib/ffi-geos.rb', line 995 def error_handler(*args) raise RuntimeError.new(args[0] % args[1]) end |
#notice_handler(*args) ⇒ Object
991 992 993 |
# File 'lib/ffi-geos.rb', line 991 def notice_handler(*args) # no-op, just to appease initGEOS. end |