diff options
-rw-r--r-- | lib/net/ssh/multi/dynamic_server.rb | 6 | ||||
-rw-r--r-- | lib/net/ssh/multi/server.rb | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/net/ssh/multi/dynamic_server.rb b/lib/net/ssh/multi/dynamic_server.rb index 0fec55a..cbdde2b 100644 --- a/lib/net/ssh/multi/dynamic_server.rb +++ b/lib/net/ssh/multi/dynamic_server.rb @@ -40,6 +40,12 @@ module Net; module SSH; module Multi (options[:properties] ||= {})[key] end + # Sets the given key/value pair in the +:properties+ key in the options + # hash. If the options hash has no :properties key, it will be created. + def []=(key, value) + (options[:properties] ||= {})[key] = value + end + # Iterates over every instantiated server record in this dynamic server. # If the servers have not yet been instantiated, this does nothing (e.g., # it does _not_ automatically invoke #evaluate!). diff --git a/lib/net/ssh/multi/server.rb b/lib/net/ssh/multi/server.rb index f53adb8..41fd97c 100644 --- a/lib/net/ssh/multi/server.rb +++ b/lib/net/ssh/multi/server.rb @@ -61,7 +61,13 @@ module Net; module SSH; module Multi # properties are described via the +:properties+ key in the options hash # when defining the Server. def [](key) - (options[:properties] ||= {})[key] + (options[:properties] || {})[key] + end + + # Sets the given key/value pair in the +:properties+ key in the options + # hash. If the options hash has no :properties key, it will be created. + def []=(key, value) + (options[:properties] ||= {})[key] = value end # Returns the port number to use for this connection. |