File: subdivisions.rb

package info (click to toggle)
ruby-maxminddb 0.1.22-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 200 kB
  • sloc: ruby: 926; makefile: 3
file content (17 lines) | stat: -rw-r--r-- 340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module MaxMindDB
  class Result
    class Subdivisions < Array
      def initialize(raw)
        super((raw || []).map { |hash| NamedLocation.new(hash) })
      end

      def most_specific
        last || NamedLocation.new({})
      end

      def inspect
        "#<MaxMindDB::Result::Subdivisions: #{super}>"
      end
    end
  end
end