Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- lib/torasup/configuration.rb
Constant Summary collapse
- DEFAULT_COUNTRIES =
%w[US GB AU IT RU NO].freeze
Instance Attribute Summary collapse
-
#custom_pstn_data_files ⇒ Object
Returns the value of attribute custom_pstn_data_files.
-
#default_countries ⇒ Object
Returns the value of attribute default_countries.
-
#registered_operators ⇒ Object
Returns the value of attribute registered_operators.
Instance Method Summary collapse
- #custom_pstn_data_file=(value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #register_operators(country_code, *operators) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
5 6 7 |
# File 'lib/torasup/configuration.rb', line 5 def initialize @default_countries = DEFAULT_COUNTRIES end |
Instance Attribute Details
#custom_pstn_data_files ⇒ Object
Returns the value of attribute custom_pstn_data_files.
3 4 5 |
# File 'lib/torasup/configuration.rb', line 3 def custom_pstn_data_files @custom_pstn_data_files end |
#default_countries ⇒ Object
Returns the value of attribute default_countries.
3 4 5 |
# File 'lib/torasup/configuration.rb', line 3 def default_countries @default_countries end |
#registered_operators ⇒ Object
Returns the value of attribute registered_operators.
3 4 5 |
# File 'lib/torasup/configuration.rb', line 3 def registered_operators @registered_operators end |
Instance Method Details
#custom_pstn_data_file=(value) ⇒ Object
14 15 16 17 18 |
# File 'lib/torasup/configuration.rb', line 14 def custom_pstn_data_file=(value) @custom_pstn_data_files ||= [] value ? (@custom_pstn_data_files << value) : @custom_pstn_data_files.clear Torasup.load_pstn_data! end |
#register_operators(country_code, *operators) ⇒ Object
20 21 22 23 |
# File 'lib/torasup/configuration.rb', line 20 def register_operators(country_code, *operators) registered_operators[country_code] = operators Torasup.load_pstn_data! end |