Class: TelephoneNumber::GeoLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/telephone_number/geo_locator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(phone_number, locale) ⇒ GeoLocator

initialize with a phone_number object



6
7
8
9
10
# File 'lib/telephone_number/geo_locator.rb', line 6

def initialize(phone_number, locale)
  @phone_number = phone_number
  @normalized_number = build_normalized_number
  @locale = locale
end

Instance Attribute Details

#localeObject (readonly)

Returns the value of attribute locale.



3
4
5
# File 'lib/telephone_number/geo_locator.rb', line 3

def locale
  @locale
end

#locationObject (readonly)

Returns the value of attribute location.



3
4
5
# File 'lib/telephone_number/geo_locator.rb', line 3

def location
  @location
end

#normalized_numberObject (readonly)

Returns the value of attribute normalized_number.



3
4
5
# File 'lib/telephone_number/geo_locator.rb', line 3

def normalized_number
  @normalized_number
end

#phone_numberObject (readonly)

Returns the value of attribute phone_number.



3
4
5
# File 'lib/telephone_number/geo_locator.rb', line 3

def phone_number
  @phone_number
end

Instance Method Details

#location_dataObject



16
17
18
# File 'lib/telephone_number/geo_locator.rb', line 16

def location_data
  @location_data ||= fetch_location_data
end