Sha256: bd564f436751c48220fef4bfafe8b3a641a5577c1f37286abaea68ff7f389aef
Contents?: true
Size: 547 Bytes
Versions: 2
Compression:
Stored size: 547 Bytes
Contents
module Biggs class Format attr_reader :country_name, :iso_code, :format_string, :country def initialize(iso_code) @iso_code = iso_code.to_s.downcase @country = Biggs.country[@iso_code] @country_name = @country ? @country.name : nil @format_string = @country ? @country.address_format : nil 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 |
---|---|
eropple-biggs-0.4.0 | lib/biggs/format.rb |
eropple-biggs-0.3.4 | lib/biggs/format.rb |