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: '', location: nil) ⇒ GeofenceMap
constructor
A new instance of GeofenceMap.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id: '', longitude: '', latitude: '', name: '', radius: '', location: nil) ⇒ GeofenceMap
Returns a new instance of GeofenceMap.
1076 1077 1078 1079 1080 1081 1082 |
# File 'lib/ruby-macrodroid.rb', line 1076 def initialize(id: '', longitude: '', latitude: '', name: '', radius: '', location: nil) @id, @latitude, @longitude, @name, @radius, @location = id, latitude, \ longitude, name, radius, location end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
1074 1075 1076 |
# File 'lib/ruby-macrodroid.rb', line 1074 def id @id end |
#latitude ⇒ Object
Returns the value of attribute latitude.
1074 1075 1076 |
# File 'lib/ruby-macrodroid.rb', line 1074 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
1074 1075 1076 |
# File 'lib/ruby-macrodroid.rb', line 1074 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
1074 1075 1076 |
# File 'lib/ruby-macrodroid.rb', line 1074 def name @name end |
#radius ⇒ Object
Returns the value of attribute radius.
1074 1075 1076 |
# File 'lib/ruby-macrodroid.rb', line 1074 def radius @radius end |
Instance Method Details
#to_h ⇒ Object
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 |
# File 'lib/ruby-macrodroid.rb', line 1084 def to_h() { id: @id, longitude: @longitude, latitude: @latitude, name: @name, radius: @radius } end |
#to_s ⇒ Object
1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 |
# File 'lib/ruby-macrodroid.rb', line 1096 def to_s() lines = [] coordinates = "%s, %s" % [@latitude, @longitude] lines << "%s" % @name lines << " location: %s" % @location if @location lines << " coordinates: %s" % coordinates lines << " radius: %s" % @radius lines.join("\n") end |