Class: SafeNet::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/safenet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/safenet.rb', line 19

def initialize(options = {})
  @app_info = defaults()
  set_app_info(options) if options.any?
  @key_helper = SafeNet::KeyHelper.new(self)
  @auth = SafeNet::Auth.new(self)
  @nfs = SafeNet::NFS.new(self)
  @dns = SafeNet::DNS.new(self)
  @sd = SafeNet::SD.new(self)
  @ad = SafeNet::AD.new(self)
  @immutable = SafeNet::Immutable.new(self)
  @cipher = SafeNet::Cipher.new(self)
  @data_id = SafeNet::DataId.new(self)
end

Instance Attribute Details

#adObject (readonly)

Returns the value of attribute ad.



17
18
19
# File 'lib/safenet.rb', line 17

def ad
  @ad
end

#app_infoObject (readonly)

Returns the value of attribute app_info.



17
18
19
# File 'lib/safenet.rb', line 17

def app_info
  @app_info
end

#authObject (readonly)

Returns the value of attribute auth.



17
18
19
# File 'lib/safenet.rb', line 17

def auth
  @auth
end

#cipherObject (readonly)

Returns the value of attribute cipher.



17
18
19
# File 'lib/safenet.rb', line 17

def cipher
  @cipher
end

#data_idObject (readonly)

Returns the value of attribute data_id.



17
18
19
# File 'lib/safenet.rb', line 17

def data_id
  @data_id
end

#dnsObject (readonly)

Returns the value of attribute dns.



17
18
19
# File 'lib/safenet.rb', line 17

def dns
  @dns
end

#immutableObject (readonly)

Returns the value of attribute immutable.



17
18
19
# File 'lib/safenet.rb', line 17

def immutable
  @immutable
end

#key_helperObject (readonly)

Returns the value of attribute key_helper.



17
18
19
# File 'lib/safenet.rb', line 17

def key_helper
  @key_helper
end

#nfsObject (readonly)

Returns the value of attribute nfs.



17
18
19
# File 'lib/safenet.rb', line 17

def nfs
  @nfs
end

#sdObject (readonly)

Returns the value of attribute sd.



17
18
19
# File 'lib/safenet.rb', line 17

def sd
  @sd
end

Instance Method Details

#set_app_info(options = {}) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/safenet.rb', line 33

def set_app_info(options = {})
  @app_info[:permissions] = options[:permissions] if options.has_key?(:permissions)
  @app_info[:name] = options[:name] if options.has_key?(:name)
  @app_info[:version] = options[:version] if options.has_key?(:version)
  @app_info[:vendor] = options[:vendor] if options.has_key?(:vendor)
  @app_info[:id] = options[:id] if options.has_key?(:id)
  @app_info[:launcher_server] = options[:server] if options.has_key?(:server)
  @app_info[:conf_path] = options[:conf_file] if options.has_key?(:conf_file)
end