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.
416 417 418 419 420 421 422 |
# File 'lib/ruby-macrodroid.rb', line 416 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.
414 415 416 |
# File 'lib/ruby-macrodroid.rb', line 414 def id @id end |
#latitude ⇒ Object
Returns the value of attribute latitude.
414 415 416 |
# File 'lib/ruby-macrodroid.rb', line 414 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
414 415 416 |
# File 'lib/ruby-macrodroid.rb', line 414 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
414 415 416 |
# File 'lib/ruby-macrodroid.rb', line 414 def name @name end |
#radius ⇒ Object
Returns the value of attribute radius.
414 415 416 |
# File 'lib/ruby-macrodroid.rb', line 414 def radius @radius end |
Instance Method Details
#to_h ⇒ Object
424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/ruby-macrodroid.rb', line 424 def to_h() { id: @id, longitude: @longitude, latitude: @latitude, name: @name, radius: @radius } end |
#to_s(colour: false) ⇒ Object
436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/ruby-macrodroid.rb', line 436 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 |