Class: Sym::App::Password::Providers::DrbProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/sym/app/password/providers/drb_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ DrbProvider

Returns a new instance of DrbProvider.



12
13
14
15
16
17
# File 'lib/sym/app/password/providers/drb_provider.rb', line 12

def initialize(**opts)
  Coin.uri  = opts[:uri] || Sym::Configuration.config.password_cache_arguments[:drb][:opts][:uri]
  self.coin = Coin
  alive?
  self
end

Instance Attribute Details

#coinObject

Returns the value of attribute coin.



10
11
12
# File 'lib/sym/app/password/providers/drb_provider.rb', line 10

def coin
  @coin
end

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/sym/app/password/providers/drb_provider.rb', line 19

def alive?
  self.read('bogus') rescue nil
  self.coin.server_running?
end

#clearObject



32
33
34
# File 'lib/sym/app/password/providers/drb_provider.rb', line 32

def clear
  coin.clear
end

#read(*args) ⇒ Object



28
29
30
# File 'lib/sym/app/password/providers/drb_provider.rb', line 28

def read(*args)
  coin.send(:read, *args)
end

#write(*args) ⇒ Object



24
25
26
# File 'lib/sym/app/password/providers/drb_provider.rb', line 24

def write(*args)
  coin.server.send(:write, *args)
end