Class: Ahoy::Deckhands::LocationDeckhand
- Inherits:
-
Object
- Object
- Ahoy::Deckhands::LocationDeckhand
- Defined in:
- lib/ahoy/deckhands/location_deckhand.rb
Instance Method Summary collapse
- #city ⇒ Object
- #country ⇒ Object
-
#initialize(ip) ⇒ LocationDeckhand
constructor
A new instance of LocationDeckhand.
- #region ⇒ Object
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
#city ⇒ Object
17 18 19 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 17 def city location.try(:city).presence end |
#country ⇒ Object
9 10 11 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 9 def country location.try(:country).presence end |
#region ⇒ Object
13 14 15 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 13 def region location.try(:state).presence end |