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.
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 986 |
# File 'lib/ffi-geos.rb', line 977 def initialize @ptr = FFIGeos.initGEOS_r( @notice_handler = self.method(:notice_handler), @error_handler = self.method(:error_handler) ) Kernel.at_exit { FFIGeos.finishGEOS_r(@ptr) } 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 |
Instance Method Details
#error_handler(*args) ⇒ Object
992 993 994 |
# File 'lib/ffi-geos.rb', line 992 def error_handler(*args) raise RuntimeError.new(args[0] % args[1]) end |
#notice_handler(*args) ⇒ Object
988 989 990 |
# File 'lib/ffi-geos.rb', line 988 def notice_handler(*args) # no-op, just to appease initGEOS. end |