Sha256: 6104aa123a8668a500ba978f6a7af3ad6f437b1466fe2540bd92a4e258c70806

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

module Biggs
  class Format
    attr_reader :country_name, :iso_code, :format_string
    
    DEFAULT_WITH_STATE = 
    
    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

2 entries across 2 versions & 1 rubygems

Version Path
biggs-0.3.1 lib/biggs/format.rb
biggs-0.3.0 lib/biggs/format.rb