Class: AutoRemoteRequest
- Inherits:
-
Object
- Object
- AutoRemoteRequest
- Includes:
- HTTParty
- Defined in:
- lib/autoremote/net.rb
Class Method Summary collapse
- .message(key, sender, message) ⇒ Object
- .register(key, id, name, publicip, localip) ⇒ Object
- .validate_key(key) ⇒ Object
- .validate_url(url) ⇒ Object
Class Method Details
.message(key, sender, message) ⇒ Object
11 12 13 |
# File 'lib/autoremote/net.rb', line 11 def self.(key, sender, ) get('/sendmessage', query: { key: key, sender: sender, message: }) end |
.register(key, id, name, publicip, localip) ⇒ Object
7 8 9 |
# File 'lib/autoremote/net.rb', line 7 def self.register(key, id, name, publicip, localip) get('/registerpc', query: { key: key, id: id, name: name, publicip: publicip, localip: localip }) end |
.validate_key(key) ⇒ Object
15 16 17 |
# File 'lib/autoremote/net.rb', line 15 def self.validate_key(key) get('/sendmessage', query: { key: key }) end |
.validate_url(url) ⇒ Object
19 20 21 22 23 |
# File 'lib/autoremote/net.rb', line 19 def self.validate_url(url) ## Add https:// to the url if not present url.prepend 'https://' unless url.match(/^https?:\/{2}/i) get(url) end |