Class: Proj4::Def

Inherits:
Object
  • Object
show all
Defined in:
lib/proj4rb.rb

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

- (Def) initialize

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

Raises:

  • (TypeError)


362
363
364
# File 'lib/proj4rb.rb', line 362

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

Class Method Details

+ (Object) get(id)

Get the definition with given id.



367
368
369
# File 'lib/proj4rb.rb', line 367

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

Instance Method Details

- (Object) <=>(other)

Compares definitions by comparing ids.

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



383
384
385
# File 'lib/proj4rb.rb', line 383

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

- (Object) ==(other)

Compares definitions by comparing ids.

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



375
376
377
# File 'lib/proj4rb.rb', line 375

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

- (Object) to_s

Stringify definition. Returns ID of this definition.

call-seq: to_s -> String



391
392
393
# File 'lib/proj4rb.rb', line 391

def to_s
    id
end