Class: Geos::Handle

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi-geos.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHandle

Deprecated initialization and teardown…



1223
1224
1225
1226
1227
1228
# File 'lib/ffi-geos.rb', line 1223

def initialize
  @ptr = FFI::AutoPointer.new(FFIGeos.GEOS_init_r, self.class.method(:release))

  reset_notice_handler
  reset_error_handler
end

Instance Attribute Details

#error_handler(&block) ⇒ Object

Returns the value of attribute error_handler.



1208
1209
1210
1211
# File 'lib/ffi-geos.rb', line 1208

def error_handler(&block)
  self.error_handler = block if block_given?
  @error_handler
end

#notice_handler(&block) ⇒ Object

Returns the value of attribute notice_handler.



1203
1204
1205
1206
# File 'lib/ffi-geos.rb', line 1203

def notice_handler(&block)
  self.notice_handler = block if block_given?
  @notice_handler
end

#ptrObject (readonly)

Returns the value of attribute ptr.



1179
1180
1181
# File 'lib/ffi-geos.rb', line 1179

def ptr
  @ptr
end

Class Method Details

.release(ptr) ⇒ Object



1189
1190
1191
# File 'lib/ffi-geos.rb', line 1189

def self.release(ptr)
  FFIGeos.GEOS_finish_r(ptr)
end

Instance Method Details

#reset_error_handlerObject



1217
1218
1219
# File 'lib/ffi-geos.rb', line 1217

def reset_error_handler
  self.error_handler = method(:default_error_handler)
end

#reset_notice_handlerObject



1213
1214
1215
# File 'lib/ffi-geos.rb', line 1213

def reset_notice_handler
  self.notice_handler = method(:default_notice_handler)
end