base_evaluator.rb revision 69905ef9f951245465b09c8c011da40f74990c02
# - Meta component
# This is the base class of the Hets Evaluators It should not be used
# directly but instead be subclassed. This is necessary since we usually
# want to register specific callbacks. See Hets::*::*Evaluator for the
# actual evaluators.
# - Meta method
# registers a callback-method for a specific node (with node meaning a
# denominator for an element which occurs in the Hets DGXML output)
# - The (node_type, order) pair is the signature
# of a registration. Multiple callback methods can
# be registered for one signature.
# - to: is the symbol-designator of the method.
end
@registrations ||= {}
end
end
end
# - Meta method
# This is the main method that is being called during the
# parsing process. It decides which actual method will
# be called in order to process the parse step. This may
# be a no-op.
# If there is a registered method which corresponds to
# the signature (node_type, order) this will be called.
# Otherwise it falls back to the default naming schema of
# 'nodetype_order' as method name. This default method
# will only be called if it is defined, thus resulting
# in a no-op as fallback.
if registered?(node_type, order)
end
else
default_method_name = :"#{node_type}_#{order}"
end
raise e
end
if method_name
else
end
end
end
end
end