Sha256: 850cf8980414e1fa316b47c323f778b25e6f62af09b2d4adebe9ff04df999f03

Contents?: true

Size: 354 Bytes

Versions: 6

Compression:

Stored size: 354 Bytes

Contents

module ISO3166
  ##
  # Handles building the in memory store of countries data
  class Setup
    def codes
      @codes ||= Data.codes
    end

    def data
      return @data if instance_variable_defined?('@data')
      @data = {}
      codes.each do |alpha2|
        @data[alpha2] = Data.new(alpha2).call
      end
      @data.freeze
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
countries-1.2.5 lib/countries/setup.rb
countries-1.2.4 lib/countries/setup.rb
countries-1.2.2 lib/countries/setup.rb
countries-1.2.1 lib/countries/setup.rb
countries-1.1.0 lib/countries/setup.rb
countries-1.0.0 lib/countries/setup.rb