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.



1038
1039
1040
1041
1042
1043
# File 'lib/ruby-macrodroid.rb', line 1038

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.



1036
1037
1038
# File 'lib/ruby-macrodroid.rb', line 1036

def id
  @id
end

#latitudeObject

Returns the value of attribute latitude.



1036
1037
1038
# File 'lib/ruby-macrodroid.rb', line 1036

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



1036
1037
1038
# File 'lib/ruby-macrodroid.rb', line 1036

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



1036
1037
1038
# File 'lib/ruby-macrodroid.rb', line 1036

def name
  @name
end

#radiusObject

Returns the value of attribute radius.



1036
1037
1038
# File 'lib/ruby-macrodroid.rb', line 1036

def radius
  @radius
end

Instance Method Details

#to_hObject



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
# File 'lib/ruby-macrodroid.rb', line 1045

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

#to_sObject



1057
1058
1059
1060
1061
1062
# File 'lib/ruby-macrodroid.rb', line 1057

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