Sha256: b14dfab6ddf48603d80ecd3f5e2f33cb274c143dc7fa626780fc923da94fa3fc

Contents?: true

Size: 469 Bytes

Versions: 4

Compression:

Stored size: 469 Bytes

Contents

module Biggs
  class Format
    attr_reader :country_name, :iso_code, :format_string

    def initialize(iso_code)
      @iso_code = iso_code.to_s.downcase
      @country_name = Biggs::COUNTRY_NAMES[@iso_code]
      @format_string = Biggs::FORMATS[@iso_code]
    end

    class << self
      def find(iso_code)
        entries_cache[iso_code] ||= new(iso_code)
      end

      private

      def entries_cache
        @entries_cache ||= {}
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
biggs-0.7.0 lib/biggs/format.rb
biggs-0.6.0 lib/biggs/format.rb
biggs-0.5.1 lib/biggs/format.rb
biggs-0.5.0 lib/biggs/format.rb