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