Class: Osgb::Projection
- Inherits:
-
Object
- Object
- Osgb::Projection
- Defined in:
- lib/osgb/projection.rb
Constant Summary collapse
- @@instances =
{}
Instance Attribute Summary collapse
-
#e0 ⇒ Object
Returns the value of attribute e0.
-
#ellipsoid ⇒ Object
Returns the value of attribute ellipsoid.
-
#lambda0 ⇒ Object
Returns the value of attribute lambda0.
-
#n0 ⇒ Object
Returns the value of attribute n0.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phi0 ⇒ Object
Returns the value of attribute phi0.
-
#scale ⇒ Object
Returns the value of attribute scale.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, attributes) ⇒ Projection
constructor
A new instance of Projection.
Constructor Details
#initialize(name, attributes) ⇒ Projection
Returns a new instance of Projection.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/osgb/projection.rb', line 6 def initialize(name, attributes) @name = name @scale = attributes[:scale] @phi0 = attributes[:phi0].to_radians @lambda0 = attributes[:lambda0].to_radians @e0 = attributes[:e0] @n0 = attributes[:n0] @ellipsoid = Osgb::Ellipsoid[attributes[:ellipsoid]] @@instances[name] = self end |
Instance Attribute Details
#e0 ⇒ Object
Returns the value of attribute e0.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def e0 @e0 end |
#ellipsoid ⇒ Object
Returns the value of attribute ellipsoid.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def ellipsoid @ellipsoid end |
#lambda0 ⇒ Object
Returns the value of attribute lambda0.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def lambda0 @lambda0 end |
#n0 ⇒ Object
Returns the value of attribute n0.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def n0 @n0 end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def name @name end |
#phi0 ⇒ Object
Returns the value of attribute phi0.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def phi0 @phi0 end |
#scale ⇒ Object
Returns the value of attribute scale.
3 4 5 |
# File 'lib/osgb/projection.rb', line 3 def scale @scale end |
Class Method Details
.[](name) ⇒ Object
17 18 19 |
# File 'lib/osgb/projection.rb', line 17 def self.[](name) @@instances[name] end |