Class: GeoSpider::Location
- Inherits:
-
Object
- Object
- GeoSpider::Location
- Defined in:
- lib/geo-spider/location.rb
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(params = {}) ⇒ Location
Returns a new instance of Location.
7 8 9 10 11 12 13 14 |
# File 'lib/geo-spider/location.rb', line 7 def initialize(params = {}) raise "No longitude provided" unless params[:longitude] raise "No latitude provided" unless params[:latitude] @latitude = params[:latitude] @longitude = params[:longitude] @title = params[:title] end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
5 6 7 |
# File 'lib/geo-spider/location.rb', line 5 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
5 6 7 |
# File 'lib/geo-spider/location.rb', line 5 def longitude @longitude end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/geo-spider/location.rb', line 5 def title @title end |