Sha256: 905db03da9d680fcfba6c82cbee49e9185815cd08e552204efdf55821a3ad1ea

Contents?: true

Size: 575 Bytes

Versions: 11

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}][#{@inV}-#{@label}->#{@outV}]"
    end
    alias to_s inspect
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
grumlin-0.11.0 lib/grumlin/edge.rb
grumlin-0.10.1 lib/grumlin/edge.rb
grumlin-0.10.0 lib/grumlin/edge.rb
grumlin-0.9.0 lib/grumlin/edge.rb
grumlin-0.8.0 lib/grumlin/edge.rb
grumlin-0.7.0 lib/grumlin/edge.rb
grumlin-0.6.2 lib/grumlin/edge.rb
grumlin-0.6.1 lib/grumlin/edge.rb
grumlin-0.6.0 lib/grumlin/edge.rb
grumlin-0.5.1 lib/grumlin/edge.rb
grumlin-0.5.0 lib/grumlin/edge.rb