Class: Sym::App::Password::Providers::DrbProvider
- Defined in:
- lib/sym/app/password/providers/drb_provider.rb
Instance Attribute Summary collapse
-
#coin ⇒ Object
Returns the value of attribute coin.
Instance Method Summary collapse
- #alive? ⇒ Boolean
- #clear ⇒ Object
-
#initialize(**opts) ⇒ DrbProvider
constructor
A new instance of DrbProvider.
- #read(*args) ⇒ Object
- #write(*args) ⇒ Object
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
#coin ⇒ Object
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
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 |
#clear ⇒ Object
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 |