lib/universa/binder.rb in universa-3.13.2.2 vs lib/universa/binder.rb in universa-3.14.2.1
- old
+ new
@@ -27,10 +27,14 @@
# Retrieve binder keys
def keys
__getobj__.keySet()
end
+ def binary(key)
+ __getobj__.getBinary(key)
+ end
+
# # Internal use only. Allow processing remote commands as local calls
def respond_to_missing?(method_name, include_private = false)
l = method_name[-1]
LOCAL_METHODS.include?(method_name) || l == '!' || l == '?'
end
@@ -55,10 +59,11 @@
def to_s
to_h.to_s
end
# Converts binder to the array of [key, value] pairs, like with regular ruby hashes
+ # @return [Array(Array(String,Object))] array of [key,value] pairs.
def to_a
map {|x| x}
end
# Enumerates all binder entries with a required block
@@ -69,14 +74,9 @@
# @return an array of values returned by the block
# @yield [key,value] pairs.
def map(&block)
keys.map {|k| block.call [k, __getobj__.get(k)]}
- end
-
- # @return [Array(Array(String,Object))] array of [key,value] pairs.
- def to_a
- map {|x| x}
end
# converts to a regular ruby hash
def to_h
to_a.to_h