Sha256: 9be77190dfe91541bf5c92a4b2a9b5a75fdf43f9c0e76eed5d5f114f86974d55

Contents?: true

Size: 358 Bytes

Versions: 24

Compression:

Stored size: 358 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
    alias to_s inspect
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
grumlin-0.14.1 lib/grumlin/vertex.rb
grumlin-0.14.0 lib/grumlin/vertex.rb
grumlin-0.13.1 lib/grumlin/vertex.rb
grumlin-0.13.0 lib/grumlin/vertex.rb
grumlin-0.12.5 lib/grumlin/vertex.rb
grumlin-0.12.4 lib/grumlin/vertex.rb
grumlin-0.12.3 lib/grumlin/vertex.rb
grumlin-0.12.2 lib/grumlin/vertex.rb
grumlin-0.12.1 lib/grumlin/vertex.rb
grumlin-0.12.0 lib/grumlin/vertex.rb
grumlin-0.11.0 lib/grumlin/vertex.rb
grumlin-0.10.1 lib/grumlin/vertex.rb
grumlin-0.10.0 lib/grumlin/vertex.rb
grumlin-0.9.0 lib/grumlin/vertex.rb
grumlin-0.8.0 lib/grumlin/vertex.rb
grumlin-0.7.0 lib/grumlin/vertex.rb
grumlin-0.6.2 lib/grumlin/vertex.rb
grumlin-0.6.1 lib/grumlin/vertex.rb
grumlin-0.6.0 lib/grumlin/vertex.rb
grumlin-0.5.1 lib/grumlin/vertex.rb