Module: H3::Bindings::Base
- Included in:
- Private, Hierarchy, Indexing, Inspection, Miscellaneous, Regions, Traversal, UnidirectionalEdges
- Defined in:
- lib/h3/bindings/base.rb
Overview
Base for FFI Bindings.
When extended, this module sets up FFI to use the H3 C library.
Class Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/h3/bindings/base.rb', line 7 def self.extended(base) lib_path = File.(__dir__ + "/../../../ext/h3/src/lib") base.extend FFI::Library base.extend Gem::Deprecate base.include Structs base.include Types base.ffi_lib ["#{lib_path}/libh3.dylib", "#{lib_path}/libh3.so"] base.typedef :ulong_long, :h3_index base.typedef :int, :size base.typedef :int, :k_distance base.typedef :pointer, :h3_set base.typedef :pointer, :output_buffer base.const_set("H3_INDEX", :ulong_long) end |