Class: Censys::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/censys/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Location

Initializes the location information.

Parameters:

  • attributes (Hash{String => Object})


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/censys/location.rb', line 38

def initialize(attributes)
  @postal_code = attributes['postal_code']
  @city        = attributes['city']
  @province    = attributes['province']
  @country     = attributes['country']
  @continent   = attributes['continent']

  @registered_country      = attributes['registered_country']
  @registered_country_code = attributes['registered_country_code']

  @timezone = attributes['timezone']

  @latitude  = attributes['latitude']
  @longitude = attributes['longitude']
end

Instance Attribute Details

#cityString (readonly)

Returns:

  • (String)


7
8
9
# File 'lib/censys/location.rb', line 7

def city
  @city
end

#continentString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/censys/location.rb', line 16

def continent
  @continent
end

#countryString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/censys/location.rb', line 13

def country
  @country
end

#latitudeFloat (readonly)

Returns:

  • (Float)


28
29
30
# File 'lib/censys/location.rb', line 28

def latitude
  @latitude
end

#longitudeFloat (readonly)

Returns:

  • (Float)


31
32
33
# File 'lib/censys/location.rb', line 31

def longitude
  @longitude
end

#postal_codeString (readonly)

Returns:

  • (String)


4
5
6
# File 'lib/censys/location.rb', line 4

def postal_code
  @postal_code
end

#provinceString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/censys/location.rb', line 10

def province
  @province
end

#registered_countryString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/censys/location.rb', line 19

def registered_country
  @registered_country
end

#registered_country_codeString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/censys/location.rb', line 22

def registered_country_code
  @registered_country_code
end

#timezoneString (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/censys/location.rb', line 25

def timezone
  @timezone
end