Class: Proj4::Def

Inherits:
Object
  • Object
show all
Defined in:
lib/proj4.rb,
ext/projrb.c

Overview

Abstract base class for several types of definitions: Proj4::Datum, Proj4::Ellipsoid, Proj4::PrimeMeridian, Proj4::ProjectionType, Proj4::Unit.

Note that these classes only work if the version of the Proj.4 C library used is at least 449.

Direct Known Subclasses

Datum, Ellipsoid, PrimeMeridian, ProjectionType, Unit

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDef

Initialize function raises error. Definitions are always defined by the underlying Proj.4 library, you can’t create them yourself.

Raises:

  • (TypeError)


368
369
370
# File 'lib/proj4.rb', line 368

def initialize # :nodoc:
  raise TypeError, "You can't created objects of this type yourself."
end

Class Method Details

.get(id) ⇒ Object

Get the definition with given id.



373
374
375
# File 'lib/proj4.rb', line 373

def self.get(id)
  self.list.select{ |u| u.id == id }.first
end

Instance Method Details

#<=>(other) ⇒ Object

Compares definitions by comparing ids.

call-seq: one <=> other -> -1, 0, 1



389
390
391
# File 'lib/proj4.rb', line 389

def <=>(other)
  self.id <=> other.id
end

#==(other) ⇒ Object

Compares definitions by comparing ids.

call-seq: one == other -> true or false



381
382
383
# File 'lib/proj4.rb', line 381

def ==(other)
  self.id == other.id
end

#to_sObject

Stringify definition. Returns ID of this definition.

call-seq: to_s -> String



397
398
399
# File 'lib/proj4.rb', line 397

def to_s
  id
end