Class: Geocoder::Result::Telize

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/telize.rb

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#coordinates, #initialize, #latitude, #longitude, #province, #province_code

Constructor Details

This class inherits a constructor from Geocoder::Result::Base

Class Method Details

.response_attributesObject



35
36
37
# File 'lib/geocoder/results/telize.rb', line 35

def self.response_attributes
  %w[timezone isp dma_code area_code ip asn continent_code country_code3]
end

Instance Method Details

#address(format = :full) ⇒ Object



6
7
8
9
# File 'lib/geocoder/results/telize.rb', line 6

def address(format = :full)
  s = state_code.to_s == "" ? "" : ", #{state_code}"
  "#{city}#{s} #{postal_code}, #{country}".sub(/^[ ,]*/, "")
end

#cityObject



11
12
13
# File 'lib/geocoder/results/telize.rb', line 11

def city
  @data['city']
end

#countryObject



23
24
25
# File 'lib/geocoder/results/telize.rb', line 23

def country
  @data['country']
end

#country_codeObject



27
28
29
# File 'lib/geocoder/results/telize.rb', line 27

def country_code
  @data['country_code']
end

#postal_codeObject



31
32
33
# File 'lib/geocoder/results/telize.rb', line 31

def postal_code
  @data['postal_code']
end

#stateObject



15
16
17
# File 'lib/geocoder/results/telize.rb', line 15

def state
  @data['region']
end

#state_codeObject



19
20
21
# File 'lib/geocoder/results/telize.rb', line 19

def state_code
  @data['region_code']
end