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