Sha256: 4fd2f2f21dd52bb24eb625d8ea4b8358ccede86ee5b6c0383a8febbc8f3e642f

Contents?: true

Size: 498 Bytes

Versions: 7

Compression:

Stored size: 498 Bytes

Contents

require "expressir/model"

module Expressir
  module Express
    class ModelVisitor
      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
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
expressir-1.0.0 lib/expressir/express/model_visitor.rb
expressir-1.0.0-x86_64-linux lib/expressir/express/model_visitor.rb
expressir-1.0.0-x86_64-darwin lib/expressir/express/model_visitor.rb
expressir-1.0.0-x86-mingw32 lib/expressir/express/model_visitor.rb
expressir-1.0.0-x86-linux lib/expressir/express/model_visitor.rb
expressir-1.0.0-x64-mingw32 lib/expressir/express/model_visitor.rb
expressir-1.0.0-arm64-darwin lib/expressir/express/model_visitor.rb