module Silva::System
A location system – :wgs84, :osgb36, :en or :gridref.
Public Class Methods
create(system_name, options)
click to toggle source
A factory method to simplify and moderate creation of location systems. @param [Symbol] system_name The name of the system to be created. @param [Hash] options Parameters relevant to the given system. @return [Silva::System] A valid location system. @raises Silva::InvalidSystemError
If the given system can’t be created.
# 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