Method: CMF::Parser#each

Defined in:
lib/cmf/parser.rb

#each {|tag, value| ... } ⇒ Enumerator

Calls the given block once for each pair found in the message.

Yield Parameters:

  • tag (Integer, Object)

    The pair's tag. An integer, or the associated value found in the dictionary.

  • value (String, Integer, Boolean, Float)

    The pair's value.

Returns:

  • If no block is given.

See Also:



104
105
106
107
108
109
110
111
# File 'lib/cmf/parser.rb', line 104

def each
  return to_enum(:each) unless block_given?
  loop do
    pair = next_pair
    break if pair.nil?
    yield(pair[0], pair[1])
  end
end