Sha256: de24b7b3e6b1e56cf96e501edbcaade4b87739d0884a903b49051eb2a082a0e5

Contents?: true

Size: 514 Bytes

Versions: 171

Compression:

Stored size: 514 Bytes

Contents

require "expressir/model"

module Expressir
  module Express
    # @abstract
    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

171 entries across 171 versions & 1 rubygems

Version Path
expressir-2.1.0 lib/expressir/express/model_visitor.rb
expressir-2.0.0 lib/expressir/express/model_visitor.rb
expressir-1.4.2 lib/expressir/express/model_visitor.rb
expressir-1.4.2-x86_64-linux-musl lib/expressir/express/model_visitor.rb
expressir-1.4.2-x86_64-linux-gnu lib/expressir/express/model_visitor.rb
expressir-1.4.2-x86_64-darwin lib/expressir/express/model_visitor.rb
expressir-1.4.2-x64-mingw32 lib/expressir/express/model_visitor.rb
expressir-1.4.2-x64-mingw-ucrt lib/expressir/express/model_visitor.rb
expressir-1.4.2-arm64-darwin lib/expressir/express/model_visitor.rb
expressir-1.4.2-aarch64-linux-musl lib/expressir/express/model_visitor.rb
expressir-1.4.2-aarch64-linux-gnu lib/expressir/express/model_visitor.rb
expressir-1.4.1 lib/expressir/express/model_visitor.rb
expressir-1.4.1-x86_64-linux-musl lib/expressir/express/model_visitor.rb
expressir-1.4.1-x86_64-linux-gnu lib/expressir/express/model_visitor.rb
expressir-1.4.1-x86_64-darwin lib/expressir/express/model_visitor.rb
expressir-1.4.1-x64-mingw32 lib/expressir/express/model_visitor.rb
expressir-1.4.1-x64-mingw-ucrt lib/expressir/express/model_visitor.rb
expressir-1.4.1-arm64-darwin lib/expressir/express/model_visitor.rb
expressir-1.4.1-aarch64-linux-musl lib/expressir/express/model_visitor.rb
expressir-1.4.1-aarch64-linux-gnu lib/expressir/express/model_visitor.rb