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.



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

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.



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

def id
  @id
end

#latitudeObject

Returns the value of attribute latitude.



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

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



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

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#radiusObject

Returns the value of attribute radius.



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

def radius
  @radius
end

Instance Method Details

#to_hObject



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

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

#to_sObject



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

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