Class: Muve::Location
- Inherits:
-
Object
show all
- Includes:
- Model
- Defined in:
- lib/muve/location.rb
Instance Method Summary
collapse
Methods included from Model
#==, #attributes, #attributes=, connection, #connection, connection=, #database, database, database=, #destroy, #destroyed?, handler, #id, included, init, #initialize, #invalid?, #new_record?, #persisted?, #reload, #save!, #to_hash, #to_param
Methods included from Helper
symbolize_keys
Instance Method Details
#lat= ⇒ Object
8
|
# File 'lib/muve/location.rb', line 8
alias_method :lat=, :latitude=
|
#latitude=(value) ⇒ Object
22
23
24
|
# File 'lib/muve/location.rb', line 22
def latitude=(value)
@latitude = value.to_f
end
|
#lng= ⇒ Object
12
|
# File 'lib/muve/location.rb', line 12
alias_method :lng=, :longitude=
|
#lon= ⇒ Object
10
|
# File 'lib/muve/location.rb', line 10
alias_method :lon=, :longitude=
|
#long= ⇒ Object
14
|
# File 'lib/muve/location.rb', line 14
alias_method :long=, :longitude=
|
#longitude=(value) ⇒ Object
26
27
28
|
# File 'lib/muve/location.rb', line 26
def longitude=(value)
@longitude = value.to_f
end
|
#save ⇒ Object
30
31
32
|
# File 'lib/muve/location.rb', line 30
def save
true
end
|
#valid? ⇒ Boolean
16
17
18
19
20
|
# File 'lib/muve/location.rb', line 16
def valid?
return false unless latitude && longitude
return false unless latitude.abs <= 90 && longitude.abs <= 180
true
end
|