class Nexpose::SharedSecret
SharedSecret
class for pairing engines
Attributes
key_string[R]
ttl[R]
Public Class Methods
new(console, time_to_live)
click to toggle source
# File lib/nexpose/shared_secret.rb, line 7 def initialize(console, time_to_live) uri = "/data/admin/global/shared-secret?time-to-live=#{time_to_live}" json = JSON.parse(AJAX.put(console, uri)) self.from_json(json) end
Public Instance Methods
==(other)
click to toggle source
# File lib/nexpose/shared_secret.rb, line 23 def ==(other) return false unless self.class == other.class return false unless key_string.downcase == other.key_string.downcase true end
Also aliased as: eql?
delete(console)
click to toggle source
# File lib/nexpose/shared_secret.rb, line 18 def delete(console) uri = "/data/admin/global/remove-shared-secret?key-string=#{key_string}" AJAX.delete(console, uri) end
from_json(json)
click to toggle source
# File lib/nexpose/shared_secret.rb, line 13 def from_json(json) @key_string = json['keyString'] @ttl = json['timeToLiveInSeconds'] end