Sha256: 48ed5a8b1b6fd6192bdaf387d4a98e34e516cbf69d0164561bf97d28f7075023

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require "ffi"
require "rgeo/geo_json"

require "h3/bindings"
require "h3/geo_json"
require "h3/hierarchy"
require "h3/indexing"
require "h3/inspection"
require "h3/miscellaneous"
require "h3/regions"
require "h3/traversal"
require "h3/unidirectional_edges"

# The main H3 namespace.
#
# All public methods for the library are defined here.
#
# @see https://uber.github.io/h3/#/documentation/overview/introduction
module H3
  extend GeoJSON
  extend Hierarchy
  extend Miscellaneous
  extend Indexing
  extend Inspection
  extend Regions
  extend Traversal
  extend UnidirectionalEdges

  PREDICATES = %i[h3_indexes_neighbors h3_pentagon h3_res_class_3
                  h3_unidirectional_edge_valid h3_valid].freeze
  private_constant :PREDICATES

  class << self
    # FFI's attach_function doesn't allow method names ending with a
    # question mark. This works around the issue by dynamically
    # renaming those methods afterwards.
    PREDICATES.each do |predicate|
      alias_method "#{predicate}?", predicate
      undef_method predicate
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
h3-3.5.0 lib/h3.rb
h3-3.4.4 lib/h3.rb
h3-3.4.0 lib/h3.rb