Class: AutoRemoteRequest

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/autoremote/net.rb

Class Method Summary collapse

Class Method Details

.message(key, sender, message) ⇒ Object



11
12
13
# File 'lib/autoremote/net.rb', line 11

def self.message(key, sender, message)
    get('/sendmessage', query: { key: key, sender: sender, message: 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