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.



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/safenet.rb', line 15

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.



13
14
15
# File 'lib/safenet.rb', line 13

def ad
  @ad
end

#app_infoObject (readonly)

Returns the value of attribute app_info.



13
14
15
# File 'lib/safenet.rb', line 13

def app_info
  @app_info
end

#authObject (readonly)

Returns the value of attribute auth.



13
14
15
# File 'lib/safenet.rb', line 13

def auth
  @auth
end

#cipherObject (readonly)

Returns the value of attribute cipher.



13
14
15
# File 'lib/safenet.rb', line 13

def cipher
  @cipher
end

#data_idObject (readonly)

Returns the value of attribute data_id.



13
14
15
# File 'lib/safenet.rb', line 13

def data_id
  @data_id
end

#dnsObject (readonly)

Returns the value of attribute dns.



13
14
15
# File 'lib/safenet.rb', line 13

def dns
  @dns
end

#immutableObject (readonly)

Returns the value of attribute immutable.



13
14
15
# File 'lib/safenet.rb', line 13

def immutable
  @immutable
end

#key_helperObject (readonly)

Returns the value of attribute key_helper.



13
14
15
# File 'lib/safenet.rb', line 13

def key_helper
  @key_helper
end

#nfsObject (readonly)

Returns the value of attribute nfs.



13
14
15
# File 'lib/safenet.rb', line 13

def nfs
  @nfs
end

#sdObject (readonly)

Returns the value of attribute sd.



13
14
15
# File 'lib/safenet.rb', line 13

def sd
  @sd
end

Instance Method Details

#set_app_info(options = {}) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/safenet.rb', line 29

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