Sha256: d0a64eb6569be39cf5fab3b7390ba6ad0ceb9134390133003a0d67ca699a6faa

Contents?: true

Size: 371 Bytes

Versions: 35

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  class Vertex
    attr_reader :label, :id

    def initialize(label:, id:)
      @label = label
      @id = Typing.cast(id)
    end

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

    def inspect
      "v[#{@id}]"
    end

    def to_s
      inspect
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
grumlin-0.23.0 lib/grumlin/vertex.rb
grumlin-0.22.5 lib/grumlin/vertex.rb
grumlin-0.22.4 lib/grumlin/vertex.rb
grumlin-0.22.3 lib/grumlin/vertex.rb
grumlin-0.22.2 lib/grumlin/vertex.rb
grumlin-0.22.1 lib/grumlin/vertex.rb
grumlin-0.22.0 lib/grumlin/vertex.rb
grumlin-0.21.1 lib/grumlin/vertex.rb
grumlin-0.21.0 lib/grumlin/vertex.rb
grumlin-0.20.2 lib/grumlin/vertex.rb
grumlin-0.20.1 lib/grumlin/vertex.rb
grumlin-0.20.0 lib/grumlin/vertex.rb
grumlin-0.19.7 lib/grumlin/vertex.rb
grumlin-0.19.6 lib/grumlin/vertex.rb
grumlin-0.19.5 lib/grumlin/vertex.rb
grumlin-0.19.4 lib/grumlin/vertex.rb
grumlin-0.19.3 lib/grumlin/vertex.rb
grumlin-0.19.2 lib/grumlin/vertex.rb
grumlin-0.19.1 lib/grumlin/vertex.rb
grumlin-0.19.0 lib/grumlin/vertex.rb