Class: Supercluster
- Inherits:
-
Object
- Object
- Supercluster
- Defined in:
- lib/supercluster.rb
Defined Under Namespace
Classes: Error
Class Method Summary collapse
- .call_supercluster(method, *args) ⇒ Object
- .context ⇒ Object
- .get_clusters(*args) ⇒ Object
- .get_tiles(*args) ⇒ Object
Class Method Details
.call_supercluster(method, *args) ⇒ Object
16 17 18 |
# File 'lib/supercluster.rb', line 16 def self.call_supercluster(method, *args) context.call('callSupercluster', method, *args) end |
.context ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/supercluster.rb', line 8 def self.context @context ||= begin source = File.read(File.('supercluster-build.js', __dir__)) ExecJS.compile(source) end end |
.get_clusters(*args) ⇒ Object
20 21 22 |
# File 'lib/supercluster.rb', line 20 def self.get_clusters(*args) call_supercluster('getClusters', *args) end |
.get_tiles(*args) ⇒ Object
24 25 26 |
# File 'lib/supercluster.rb', line 24 def self.get_tiles(*args) call_supercluster('getTiles', *args) end |