Class: Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/torasup/configuration.rb

Constant Summary collapse

DEFAULT_COUNTRIES =
%w[US GB AU IT RU NO].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



5
6
7
# File 'lib/torasup/configuration.rb', line 5

def initialize
  @default_countries = DEFAULT_COUNTRIES
end

Instance Attribute Details

#custom_pstn_data_filesObject

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_countriesObject

Returns the value of attribute default_countries.



3
4
5
# File 'lib/torasup/configuration.rb', line 3

def default_countries
  @default_countries
end

#registered_operatorsObject

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