Class: I18nPhoneNumbers::PhoneNumberDesc

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_phone_numbers/phone_number_desc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ PhoneNumberDesc

Returns a new instance of PhoneNumberDesc.



23
24
25
26
27
28
29
# File 'lib/i18n_phone_numbers/phone_number_desc.rb', line 23

def initialize(hash)
  
  self.national_number_pattern = (hash["nationalNumberPattern"] || '').gsub(/\r?\n */,'')
  self.possible_number_pattern = (hash["possibleNumberPattern"] || '').gsub(/\r?\n */,'')
  self.example_number = (hash["exampleNumber"] || '').gsub(/\r?\n */,'')
  
end

Instance Attribute Details

#example_numberObject

The national_number_pattern is the pattern that a valid national significant number would match. This specifies information such as its total length and leading digits.



8
9
10
# File 'lib/i18n_phone_numbers/phone_number_desc.rb', line 8

def example_number
  @example_number
end

#national_number_patternObject

The national_number_pattern is the pattern that a valid national significant number would match. This specifies information such as its total length and leading digits.



8
9
10
# File 'lib/i18n_phone_numbers/phone_number_desc.rb', line 8

def national_number_pattern
  @national_number_pattern
end

#possible_number_patternObject

The national_number_pattern is the pattern that a valid national significant number would match. This specifies information such as its total length and leading digits.



8
9
10
# File 'lib/i18n_phone_numbers/phone_number_desc.rb', line 8

def possible_number_pattern
  @possible_number_pattern
end