Class: Graticule::Precision
- Inherits:
-
Object
- Object
- Graticule::Precision
- Includes:
- Comparable
- Defined in:
- lib/graticule/precision.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Class Method Summary collapse
- .address ⇒ Object
- .city ⇒ Object
- .country ⇒ Object
- .premise ⇒ Object
- .state ⇒ Object
- .street ⇒ Object
- .unknown ⇒ Object
- .zip ⇒ Object
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(order, name) ⇒ Precision
constructor
A new instance of Precision.
- #to_s ⇒ Object
Constructor Details
#initialize(order, name) ⇒ Precision
Returns a new instance of Precision.
7 8 9 10 |
# File 'lib/graticule/precision.rb', line 7 def initialize(order, name) @order = order @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/graticule/precision.rb', line 5 def name @name end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
5 6 7 |
# File 'lib/graticule/precision.rb', line 5 def order @order end |
Class Method Details
.address ⇒ Object
44 45 46 |
# File 'lib/graticule/precision.rb', line 44 def self.address @@address ||= Precision.new(6, "address") end |
.city ⇒ Object
32 33 34 |
# File 'lib/graticule/precision.rb', line 32 def self.city @@city ||= Precision.new(3, "city") end |
.country ⇒ Object
24 25 26 |
# File 'lib/graticule/precision.rb', line 24 def self.country @@country ||= Precision.new(1, "country") end |
.premise ⇒ Object
48 49 50 |
# File 'lib/graticule/precision.rb', line 48 def self.premise @@premise ||= Precision.new(7, "premise") end |
.state ⇒ Object
28 29 30 |
# File 'lib/graticule/precision.rb', line 28 def self.state @@state ||= Precision.new(2, "state") end |
.street ⇒ Object
40 41 42 |
# File 'lib/graticule/precision.rb', line 40 def self.street @@street ||= Precision.new(5, "street") end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 |
# File 'lib/graticule/precision.rb', line 12 def <=>(other) order <=> other.order end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/graticule/precision.rb', line 16 def to_s @name end |