Class: IParty::MaxMind::Result::Subdivisions
- Inherits:
-
Array
- Object
- Array
- IParty::MaxMind::Result::Subdivisions
- Defined in:
- lib/iparty/max_mind/result.rb
Instance Method Summary collapse
-
#initialize(raw) ⇒ Subdivisions
constructor
A new instance of Subdivisions.
- #inspect ⇒ Object
- #least_specific ⇒ Object
- #most_specific ⇒ Object
- #presence ⇒ Object
- #present? ⇒ Boolean
Constructor Details
#initialize(raw) ⇒ Subdivisions
Returns a new instance of Subdivisions.
106 107 108 |
# File 'lib/iparty/max_mind/result.rb', line 106 def initialize raw super((raw || []).map{|hash| Subdivision.new(hash) }) end |
Instance Method Details
#inspect ⇒ Object
110 111 112 |
# File 'lib/iparty/max_mind/result.rb', line 110 def inspect "#<#{self.class}:#{format("0x%x", object_id << 1)}: #{super}>" end |
#least_specific ⇒ Object
124 125 126 |
# File 'lib/iparty/max_mind/result.rb', line 124 def least_specific first || Subdivision.new end |
#most_specific ⇒ Object
128 129 130 |
# File 'lib/iparty/max_mind/result.rb', line 128 def most_specific last || Subdivision.new end |
#presence ⇒ Object
120 121 122 |
# File 'lib/iparty/max_mind/result.rb', line 120 def presence self if present? end |
#present? ⇒ Boolean
116 117 118 |
# File 'lib/iparty/max_mind/result.rb', line 116 def present? !empty? end |