Class: GeofenceMap
- Inherits:
-
Object
- Object
- GeofenceMap
- Defined in:
- lib/ruby-macrodroid.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#name ⇒ Object
Returns the value of attribute name.
-
#radius ⇒ Object
Returns the value of attribute radius.
Instance Method Summary collapse
-
#initialize(id: '', longitude: '', latitude: '', name: '', radius: '') ⇒ GeofenceMap
constructor
A new instance of GeofenceMap.
- #to_h ⇒ Object
- #to_s ⇒ Object
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
#id ⇒ Object
Returns the value of attribute id.
1036 1037 1038 |
# File 'lib/ruby-macrodroid.rb', line 1036 def id @id end |
#latitude ⇒ Object
Returns the value of attribute latitude.
1036 1037 1038 |
# File 'lib/ruby-macrodroid.rb', line 1036 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
1036 1037 1038 |
# File 'lib/ruby-macrodroid.rb', line 1036 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
1036 1037 1038 |
# File 'lib/ruby-macrodroid.rb', line 1036 def name @name end |
#radius ⇒ Object
Returns the value of attribute radius.
1036 1037 1038 |
# File 'lib/ruby-macrodroid.rb', line 1036 def radius @radius end |
Instance Method Details
#to_h ⇒ Object
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_s ⇒ Object
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 |