Class: Phonie::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/phonie/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_pathObject

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_codeObject

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_codeObject

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_lengthObject

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_formatsObject



19
20
21
# File 'lib/phonie/configuration.rb', line 19

def custom_named_formats
  @named_formats
end