Class: Expressir::Express::ModelVisitor Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/expressir/express/model_visitor.rb

Overview

This class is abstract.

Direct Known Subclasses

ResolveReferencesModelVisitor

Instance Method Summary collapse

Instance Method Details

#visit(node) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/expressir/express/model_visitor.rb', line 7

def visit(node)
  node.class.model_attrs.each do |variable|
    value = node.send(variable)

    if value.is_a? Array
      value.each do |value|
        if value.is_a? Model::ModelElement
          visit(value)
        end
      end
    elsif value.is_a? Model::ModelElement
      visit(value)
    end
  end
end