Class: DRb::GW
Overview
The GW provides a synchronized store for participants in the gateway to communicate.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Retrieves
keyfrom the GW. -
#[]=(key, v) ⇒ Object
Stores value
vatkeyin the GW. -
#initialize ⇒ GW
constructor
Creates a new GW.
Constructor Details
#initialize ⇒ GW
Creates a new GW
50 51 52 53 |
# File 'lib/drb/gw.rb', line 50 def initialize super() @hash = {} end |
Instance Method Details
#[](key) ⇒ Object
Retrieves key from the GW
57 58 59 60 61 |
# File 'lib/drb/gw.rb', line 57 def [](key) synchronize do @hash[key] end end |
#[]=(key, v) ⇒ Object
Stores value v at key in the GW
65 66 67 68 69 |
# File 'lib/drb/gw.rb', line 65 def []=(key, v) synchronize do @hash[key] = v end end |