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.



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

def initialize(ip)
  @ip = ip
end

Instance Method Details

#cityObject



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

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

#countryObject



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

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

#regionObject



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

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