Sha256: 9ef138546c0c547590e16a73f96275d4e6014753dc3414d93cfbf40882eff169

Contents?: true

Size: 564 Bytes

Versions: 1

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  class Traversal
    attr_reader :connection

    def initialize(client_or_url = Grumlin.config.default_client)
      @client = if client_or_url.is_a?(String)
                  Grumlin::Client.new(client_or_url)
                else
                  client_or_url
                end
    end

    # TODO: add other start steps
    %w[addV addE V E].each do |step|
      define_method step do |*args|
        Step.new(@client, step, *args)
      end
    end

    alias addVertex addV
    alias addEdge addE
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grumlin-0.2.0 lib/grumlin/traversal.rb