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.
- #latitude ⇒ Object
- #longitude ⇒ Object
- #postal_code ⇒ Object
- #region ⇒ Object
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
#city ⇒ Object
20 21 22 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 20 def city location.try(:city).presence end |
#country ⇒ Object
8 9 10 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 8 def country location.try(:country).presence end |
#latitude ⇒ Object
24 25 26 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 24 def latitude location.try(:latitude).presence end |
#longitude ⇒ Object
28 29 30 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 28 def longitude location.try(:longitude).presence end |
#postal_code ⇒ Object
16 17 18 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 16 def postal_code location.try(:postal_code).presence end |
#region ⇒ Object
12 13 14 |
# File 'lib/ahoy/deckhands/location_deckhand.rb', line 12 def region location.try(:state).presence end |