Class: GeofenceMap

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-macrodroid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: '', longitude: '', latitude: '', name: '', radius: '') ⇒ GeofenceMap

Returns a new instance of GeofenceMap.



996
997
998
999
1000
1001
# File 'lib/ruby-macrodroid.rb', line 996

def initialize(id: '', longitude: '', latitude: '', name: '', radius: '')
  
  @id, @latitude, @longitude, @name, @radius = id, latitude, \
      longitude, name, radius    
  
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



994
995
996
# File 'lib/ruby-macrodroid.rb', line 994

def id
  @id
end

#latitudeObject

Returns the value of attribute latitude.



994
995
996
# File 'lib/ruby-macrodroid.rb', line 994

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



994
995
996
# File 'lib/ruby-macrodroid.rb', line 994

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



994
995
996
# File 'lib/ruby-macrodroid.rb', line 994

def name
  @name
end

#radiusObject

Returns the value of attribute radius.



994
995
996
# File 'lib/ruby-macrodroid.rb', line 994

def radius
  @radius
end

Instance Method Details

#to_hObject



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# File 'lib/ruby-macrodroid.rb', line 1003

def to_h()
  
  {
    id: @id, 
    longitude: @longitude, 
    latitude: @latitude, 
    name: @name, 
    radius: @radius
  }
    
end

#to_sObject



1015
1016
1017
1018
1019
1020
# File 'lib/ruby-macrodroid.rb', line 1015

def to_s()
  
  coordinates = "%s, %s" % [@longitude, @latitude]
  "%s\n  coordinates: %s\n  radius: %s" % [@name, coordinates, @radius]
  
end