Sha256: 2a4bc10ef02dbdf51a30a33640dedb49d371ad6119d92da9b0a52455c69c656a

Contents?: true

Size: 781 Bytes

Versions: 3

Compression:

Stored size: 781 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Naming/VariableName,Naming/MethodParameterName,Naming/MethodName
module Grumlin
  class Edge
    attr_reader :label, :id, :inVLabel, :outVLabel, :inV, :outV

    def initialize(label:, id:, inVLabel:, outVLabel:, inV:, outV:) # rubocop:disable Metrics/ParameterLists
      @label = label
      @id = Typing.cast(id)
      @inVLabel = inVLabel
      @outVLabel = outVLabel
      @inV = Typing.cast(inV)
      @outV = Typing.cast(outV)
    end

    def ==(other)
      self.class == other.class && @label == other.label && @id == other.id
    end

    def inspect
      "e[#{@id}][#{@inV}-#{@label}->#{@outV}]"
    end
    alias to_s inspect
  end
end
# rubocop:enable Naming/MethodParameterName,Naming/VariableName,Naming/MethodName

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grumlin-0.4.0 lib/grumlin/edge.rb
grumlin-0.3.0 lib/grumlin/edge.rb
grumlin-0.2.0 lib/grumlin/edge.rb