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(colour: false) ⇒ Object
Constructor Details
#initialize(id: '', longitude: '', latitude: '', name: '', radius: '', location: nil) ⇒ GeofenceMap
Returns a new instance of GeofenceMap.
1117 1118 1119 1120 1121 1122 1123 |
# File 'lib/ruby-macrodroid.rb', line 1117 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.
1115 1116 1117 |
# File 'lib/ruby-macrodroid.rb', line 1115 def id @id end |
#latitude ⇒ Object
Returns the value of attribute latitude.
1115 1116 1117 |
# File 'lib/ruby-macrodroid.rb', line 1115 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
1115 1116 1117 |
# File 'lib/ruby-macrodroid.rb', line 1115 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
1115 1116 1117 |
# File 'lib/ruby-macrodroid.rb', line 1115 def name @name end |
#radius ⇒ Object
Returns the value of attribute radius.
1115 1116 1117 |
# File 'lib/ruby-macrodroid.rb', line 1115 def radius @radius end |
Instance Method Details
#to_h ⇒ Object
1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
# File 'lib/ruby-macrodroid.rb', line 1125 def to_h() { id: @id, longitude: @longitude, latitude: @latitude, name: @name, radius: @radius } end |
#to_s(colour: false) ⇒ Object
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/ruby-macrodroid.rb', line 1137 def to_s(colour: false) 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 |