Sha256: ed04575d3af5f8f221a6544bef99f9cfa8e0b39a14200ef442c765d076bbd9cd

Contents?: true

Size: 575 Bytes

Versions: 10

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  class Edge
    attr_reader :label, :id, :inVLabel, :outVLabel, :inV, :outV

    def initialize(label:, id:, inVLabel:, outVLabel:, inV:, outV:)
      @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}][#{@outV}-#{@label}->#{@inV}]"
    end
    alias to_s inspect
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
grumlin-0.14.1 lib/grumlin/edge.rb
grumlin-0.14.0 lib/grumlin/edge.rb
grumlin-0.13.1 lib/grumlin/edge.rb
grumlin-0.13.0 lib/grumlin/edge.rb
grumlin-0.12.5 lib/grumlin/edge.rb
grumlin-0.12.4 lib/grumlin/edge.rb
grumlin-0.12.3 lib/grumlin/edge.rb
grumlin-0.12.2 lib/grumlin/edge.rb
grumlin-0.12.1 lib/grumlin/edge.rb
grumlin-0.12.0 lib/grumlin/edge.rb