Module: Silva::System

Defined in:
lib/silva/system.rb,
lib/silva/system/en.rb,
lib/silva/system/base.rb,
lib/silva/system/osen.rb,
lib/silva/system/wgs84.rb,
lib/silva/system/osgb36.rb,
lib/silva/system/gridref.rb,
lib/silva/system/co_ordinate.rb

Overview

A location system – :wgs84, :osgb36, :en or :gridref.

Defined Under Namespace

Modules: CoOrdinate, OsEn Classes: Base, En, Gridref, Osgb36, Wgs84

Class Method Summary collapse

Class Method Details

.create(system_name, options) ⇒ Silva::System

A factory method to simplify and moderate creation of location systems.

Parameters:

  • system_name (Symbol)

    The name of the system to be created.

  • options (Hash)

    Parameters relevant to the given system.

Returns:



16
17
18
19
20
21
# File 'lib/silva/system.rb', line 16

def self.create(system_name, options)
  system = Silva::System.const_get(system_name.to_s.capitalize)
  system.new(options)
rescue NameError
  raise Silva::InvalidSystemError, "Can't create system: #{system_name}"
end