Class: GeneralizationRelation
- Defined in:
- lib/exploration/generalization_relation.rb
Instance Attribute Summary
Attributes inherited from Explorer
Instance Method Summary collapse
-
#each(sexp, context = nil, &block) ⇒ Object
Yields the parent of the
sexp.
Methods inherited from Relation
#each_by_type, #explore_entity_sexp, #get_name_and_namespace, #get_namespace
Instance Method Details
#each(sexp, context = nil, &block) ⇒ Object
Yields the parent of the sexp.
6 7 8 9 10 11 12 |
# File 'lib/exploration/generalization_relation.rb', line 6 def each sexp, context=nil, &block parent_node = sexp.rest.rest.head if parent_node != nil # class has a parent parent, namespace, explored = get_name_and_namespace parent_node block.call context, :generalization, { name: parent, type: :class, namespace: namespace } end end |