Class: Muve::Movement

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/muve/movement.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, #save!, #to_hash, #to_param

Methods included from Helper

symbolize_keys

Instance Method Details

#latitudeObject Also known as: lat



7
8
9
# File 'lib/muve/movement.rb', line 7

def latitude
  location[:latitude] if location
end

#latitude=(value) ⇒ Object Also known as: lat=



15
16
17
18
# File 'lib/muve/movement.rb', line 15

def latitude=(value)
  location = {} unless location
  location[:latitude]=(value) 
end

#longitudeObject Also known as: lon, lng, long



11
12
13
# File 'lib/muve/movement.rb', line 11

def longitude
  location[:longitude] if location
end

#longitude=(value) ⇒ Object Also known as: lon=, lng=, long=



20
21
22
23
# File 'lib/muve/movement.rb', line 20

def longitude=(value)
  location = {} unless location
  location[:longitude]=(value) 
end

#valid?Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
31
32
33
# File 'lib/muve/movement.rb', line 25

def valid?
  assocs.each do |assoc|
    return false unless !assoc.nil? && assoc.valid?
  end
  fields.each do |field|
    return false unless time
  end
  true
end