Class: Ahoy::Deckhands::LocationDeckhand

Inherits:
Object
  • Object
show all
Defined in:
lib/ahoy/deckhands/location_deckhand.rb

Instance Method Summary collapse

Constructor Details

#initialize(ip) ⇒ LocationDeckhand

Returns a new instance of LocationDeckhand.



4
5
6
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 4

def initialize(ip)
  @ip = ip
end

Instance Method Details

#cityObject



20
21
22
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 20

def city
  location.try(:city).presence
end

#countryObject



8
9
10
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 8

def country
  location.try(:country).presence
end

#latitudeObject



24
25
26
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 24

def latitude
  location.try(:latitude).presence
end

#longitudeObject



28
29
30
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 28

def longitude
  location.try(:longitude).presence
end

#postal_codeObject



16
17
18
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 16

def postal_code
  location.try(:postal_code).presence
end

#regionObject



12
13
14
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 12

def region
  location.try(:state).presence
end