Class: Geokit::Adapters::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/geokit-rails3/adapters/abstract.rb

Direct Known Subclasses

MySQL, Mysql2, PostgreSQL, SQLServer, SQLite

Defined Under Namespace

Classes: NotImplementedError

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ Abstract

Returns a new instance of Abstract.



12
13
14
# File 'lib/geokit-rails3/adapters/abstract.rb', line 12

def initialize(klass)
  @owner = klass
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



16
17
18
19
# File 'lib/geokit-rails3/adapters/abstract.rb', line 16

def method_missing(method, *args, &block)
  return @owner.send(method, *args, &block) if @owner.respond_to?(method)
  super
end

Class Method Details

.load(klass) ⇒ Object



9
# File 'lib/geokit-rails3/adapters/abstract.rb', line 9

def load(klass) ; end

Instance Method Details

#flat_distance_sql(origin, lat_degree_units, lng_degree_units) ⇒ Object



25
26
27
# File 'lib/geokit-rails3/adapters/abstract.rb', line 25

def flat_distance_sql(origin, lat_degree_units, lng_degree_units)
  raise NotImplementedError, '#flat_distance_sql is not implemented'
end

#sphere_distance_sql(lat, lng, multiplier) ⇒ Object



21
22
23
# File 'lib/geokit-rails3/adapters/abstract.rb', line 21

def sphere_distance_sql(lat, lng, multiplier)
  raise NotImplementedError, '#sphere_distance_sql is not implemented'
end