lib/wlang/encoder_set.rb in wlang-0.8.5 vs lib/wlang/encoder_set.rb in wlang-0.9.1
- old
+ new
@@ -23,9 +23,14 @@
# Creates an empty encoder set.
def initialize
@encoders = {}
end
+ # Yields the block with name, encoder pairs
+ def each
+ @encoders.each_pair{|name,encoder| yield(name, encoder)}
+ end
+
#
# Adds an encoder under a specific name. Supported signatures are as follows:
# - _name_ is a symbol: _encoder_ and _block_ are ignored and encoder is
# interpreted as being a method of the String class whose name is the symbol.
# - _name_ is a String and a block is provided: encoder is expected to be
\ No newline at end of file