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})


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/censys/location.rb', line 43

def initialize(attributes)
  @attributes = attributes

  @city                     = self['city']
  @continent                = self['continent']
  @country                  = self['country']
  @country_code             = self['country_code']
  @latitude                 = self['latitude']
  @longitude                = self['longitude']
  @postal_code              = self['postal_code']
  @province                 = self['province']
  @registered_country       = self['registered_country']
  @registered_country_code  = self['registered_country_code']
  @timezone                 = self['timezone']
end

Instance Attribute Details

#cityString (readonly)

Returns:

  • (String)


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

def city
  @city
end

#continentString (readonly)

Returns:

  • (String)


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

def continent
  @continent
end

#countryString (readonly)

Returns:

  • (String)


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

def country
  @country
end

#country_codeString (readonly)

Returns:

  • (String)


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

def country_code
  @country_code
end

#latitudeFloat (readonly)

Returns:

  • (Float)


33
34
35
# File 'lib/censys/location.rb', line 33

def latitude
  @latitude
end

#longitudeFloat (readonly)

Returns:

  • (Float)


36
37
38
# File 'lib/censys/location.rb', line 36

def longitude
  @longitude
end

#postal_codeString (readonly)

Returns:

  • (String)


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

def postal_code
  @postal_code
end

#provinceString (readonly)

Returns:

  • (String)


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

def province
  @province
end

#registered_countryString (readonly)

Returns:

  • (String)


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

def registered_country
  @registered_country
end

#registered_country_codeString (readonly)

Returns:

  • (String)


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

def registered_country_code
  @registered_country_code
end

#timezoneString (readonly)

Returns:

  • (String)


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

def timezone
  @timezone
end