Method: ShEx::Extension.each

Defined in:
lib/shex/extensions/extension.rb

.each {|klass| ... } ⇒ Enumerator

Enumerates known Semantic Action classes.

Yields:

  • (klass)

Yield Parameters:

  • klass (Class)

Returns:

  • (Enumerator)


54
55
56
57
58
59
60
61
62
63
# File 'lib/shex/extensions/extension.rb', line 54

def each(&block)
  if self.equal?(ShEx::Extension)
    # This is needed since all Semantic Action classes are defined using
    # Ruby's autoloading facility, meaning that `@@subclasses` will be
    # empty until each subclass has been touched or require'd.
    @@subclasses.values.each(&block)
  else
    block.call(self)
  end
end