lib/universa/binder.rb in universa-0.1.9 vs lib/universa/binder.rb in universa-0.2.1
- old
+ new
@@ -66,12 +66,12 @@
def each &block
keys.each {|k| block.call [k, __getobj__.get(k)]}
end
# @return an array of values returned by the block
- # @yiekd [key,value] pairs.
- def map &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
@@ -84,10 +84,16 @@
end
end
end
+# enhance Hash with UMI access convenience methods.
class Hash
+ # Convert the hash to the {}Binder} stored in the remote side and suitable for
+ # Universa UMI calls.
+ #
+ # @return [Binder] constructed reference to the remotely created Binder.
+ #
def to_binder
Binder.of self
end
end