Class: Phonie::Configuration
- Inherits:
-
Object
- Object
- Phonie::Configuration
- Includes:
- Singleton
- Defined in:
- lib/phonie/configuration.rb
Instance Attribute Summary collapse
-
#data_file_path ⇒ Object
Returns the value of attribute data_file_path.
-
#default_area_code ⇒ Object
Returns the value of attribute default_area_code.
-
#default_country_code ⇒ Object
Returns the value of attribute default_country_code.
-
#n1_length ⇒ Object
Returns the value of attribute n1_length.
Instance Method Summary collapse
- #add_custom_named_format(name, format_string) ⇒ Object
- #custom_named_formats ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 |
# File 'lib/phonie/configuration.rb', line 9 def initialize @data_file_path = File.join(File.dirname(__FILE__), 'data', 'phone_countries.yml') @n1_length = 3 @named_formats = {} end |
Instance Attribute Details
#data_file_path ⇒ Object
Returns the value of attribute data_file_path.
7 8 9 |
# File 'lib/phonie/configuration.rb', line 7 def data_file_path @data_file_path end |
#default_area_code ⇒ Object
Returns the value of attribute default_area_code.
7 8 9 |
# File 'lib/phonie/configuration.rb', line 7 def default_area_code @default_area_code end |
#default_country_code ⇒ Object
Returns the value of attribute default_country_code.
7 8 9 |
# File 'lib/phonie/configuration.rb', line 7 def default_country_code @default_country_code end |
#n1_length ⇒ Object
Returns the value of attribute n1_length.
7 8 9 |
# File 'lib/phonie/configuration.rb', line 7 def n1_length @n1_length end |
Instance Method Details
#add_custom_named_format(name, format_string) ⇒ Object
15 16 17 |
# File 'lib/phonie/configuration.rb', line 15 def add_custom_named_format(name, format_string) @named_formats[name.to_sym] = format_string end |
#custom_named_formats ⇒ Object
19 20 21 |
# File 'lib/phonie/configuration.rb', line 19 def custom_named_formats @named_formats end |