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.18.1 lib/grumlin/vertex.rb
grumlin-0.18.0 lib/grumlin/vertex.rb
grumlin-0.17.0 lib/grumlin/vertex.rb
grumlin-0.16.1 lib/grumlin/vertex.rb
grumlin-0.16.0 lib/grumlin/vertex.rb
grumlin-0.15.6 lib/grumlin/vertex.rb
grumlin-0.15.4 lib/grumlin/vertex.rb
grumlin-0.15.3 lib/grumlin/vertex.rb
grumlin-0.15.2 lib/grumlin/vertex.rb
grumlin-0.15.1 lib/grumlin/vertex.rb
grumlin-0.15.0 lib/grumlin/vertex.rb
grumlin-0.14.5 lib/grumlin/vertex.rb
grumlin-0.14.4 lib/grumlin/vertex.rb
grumlin-0.14.3 lib/grumlin/vertex.rb
grumlin-0.14.2 lib/grumlin/vertex.rb