Class: Vertx::SharedData::SharedHash
- Inherits:
-
Hash
- Object
- Hash
- Vertx::SharedData::SharedHash
- Defined in:
- lib/vertx/shared_data.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object (also: #store)
- #_to_java_map ⇒ Object
-
#initialize(hash) ⇒ SharedHash
constructor
A new instance of SharedHash.
Constructor Details
#initialize(hash) ⇒ SharedHash
Returns a new instance of SharedHash.
81 82 83 84 85 |
# File 'lib/vertx/shared_data.rb', line 81 def initialize(hash) @hash = hash # Pass the object to be delegated to the superclass. super(@hash) end |
Instance Method Details
#==(other) ⇒ Object
102 103 104 105 106 107 108 |
# File 'lib/vertx/shared_data.rb', line 102 def ==(other) if other.is_a?(SharedHash) @hash.equal?(other._to_java_map) else false end end |
#[](key) ⇒ Object
95 96 97 98 99 100 |
# File 'lib/vertx/shared_data.rb', line 95 def [](key) # We call the java class directly obj = @hash.get(key) obj = Buffer.new(obj) if obj.is_a? org.vertx.java.core.buffer.Buffer obj end |
#[]=(key, val) ⇒ Object Also known as: store
87 88 89 90 91 |
# File 'lib/vertx/shared_data.rb', line 87 def []=(key, val) key = SharedData.check_obj(key) val = SharedData.check_obj(val) super(key, val) end |
#_to_java_map ⇒ Object
110 111 112 |
# File 'lib/vertx/shared_data.rb', line 110 def _to_java_map @hash end |