Sha256: 484891313cb7d51ef93ccbfff03f1e063749c6ee5bfdbd3243201984c543a808

Contents?: true

Size: 447 Bytes

Versions: 10

Compression:

Stored size: 447 Bytes

Contents

# frozen_string_literal: true

class Grumlin::Vertex
  attr_reader :label, :id, :properties

  def initialize(label:, id:, properties: nil)
    @label = label
    @id = Grumlin::Typing.cast(id)
    @properties = properties&.transform_values { |v| Grumlin::Typing.cast(v) }
  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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
grumlin-1.2.0 lib/grumlin/vertex.rb
grumlin-1.1.0 lib/grumlin/vertex.rb
grumlin-1.0.4 lib/grumlin/vertex.rb
grumlin-1.0.3 lib/grumlin/vertex.rb
grumlin-1.0.3.beta1 lib/grumlin/vertex.rb
grumlin-1.0.2 lib/grumlin/vertex.rb
grumlin-1.0.1 lib/grumlin/vertex.rb
grumlin-1.0.0 lib/grumlin/vertex.rb
grumlin-1.0.0.rc7 lib/grumlin/vertex.rb
grumlin-1.0.0.rc6 lib/grumlin/vertex.rb