Class: Biggs::Format
- Inherits:
-
Object
- Object
- Biggs::Format
- Defined in:
- lib/biggs/format.rb
Instance Attribute Summary collapse
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#format_string ⇒ Object
readonly
Returns the value of attribute format_string.
-
#iso_code ⇒ Object
readonly
Returns the value of attribute iso_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(iso_code) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(iso_code) ⇒ Format
Returns a new instance of Format.
5 6 7 8 9 |
# File 'lib/biggs/format.rb', line 5 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 |
Instance Attribute Details
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name.
3 4 5 |
# File 'lib/biggs/format.rb', line 3 def country_name @country_name end |
#format_string ⇒ Object (readonly)
Returns the value of attribute format_string.
3 4 5 |
# File 'lib/biggs/format.rb', line 3 def format_string @format_string end |
#iso_code ⇒ Object (readonly)
Returns the value of attribute iso_code.
3 4 5 |
# File 'lib/biggs/format.rb', line 3 def iso_code @iso_code end |
Class Method Details
.find(iso_code) ⇒ Object
12 13 14 |
# File 'lib/biggs/format.rb', line 12 def find(iso_code) entries_cache[iso_code] ||= new(iso_code) end |