Module: CloudConnect::Units::UnitMethods
- Defined in:
- lib/cloud_connect/client/units.rb
Instance Method Summary collapse
-
#location ⇒ Integer lat, Integer long
Return the last known location of a specific unit.
-
#send_message(channel, content, opts = {}) ⇒ Hashie::Mash
Send a message to the unit.
Instance Method Details
#location ⇒ Integer lat, Integer long
Return the last known location of a specific unit
60 61 62 |
# File 'lib/cloud_connect/client/units.rb', line 60 def location [lat.to_f / 100_000, lng.to_f / 100_000] end |
#send_message(channel, content, opts = {}) ⇒ Hashie::Mash
Send a message to the unit
71 72 73 74 |
# File 'lib/cloud_connect/client/units.rb', line 71 def (channel, content, opts = {}) raise "Unknown unit id, try providing :ret => 'id' when fetching units from the API." unless id && id > 0 _cloud_connect.(id, channel, content, opts) end |