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

#initializeDrbProvider

Returns a new instance of DrbProvider.



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

def initialize
  Coin.uri  = Sym::Configuration.config.password_cache_arguments[:drb][:opts][:uri]
  self.coin = Coin
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)


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

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

#read(*args) ⇒ Object



26
27
28
# File 'lib/sym/app/password/providers/drb_provider.rb', line 26

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

#write(*args) ⇒ Object



22
23
24
# File 'lib/sym/app/password/providers/drb_provider.rb', line 22

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