lib/h3.rb in h3-3.3.1 vs lib/h3.rb in h3-3.4.0

- old
+ new

@@ -15,25 +15,26 @@ # # All public methods for the library are defined here. # # @see https://uber.github.io/h3/#/documentation/overview/introduction module H3 - class << self - include GeoJSON - include Hierarchy - include Miscellaneous - include Indexing - include Inspection - include Regions - include Traversal - include UnidirectionalEdges + 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 = %i[h3_indexes_neighbors h3_pentagon h3_res_class_3 - h3_unidirectional_edge_valid h3_valid].freeze - private_constant :PREDICATES PREDICATES.each do |predicate| alias_method "#{predicate}?", predicate undef_method predicate end end