lib/grumlin/edge.rb in grumlin-0.23.0 vs lib/grumlin/edge.rb in grumlin-1.0.0.rc1

- old
+ new

@@ -1,28 +1,26 @@ # frozen_string_literal: true -module Grumlin - class Edge - attr_reader :label, :id, :inVLabel, :outVLabel, :inV, :outV +class Grumlin::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 initialize(label:, id:, inVLabel:, outVLabel:, inV:, outV:) + @label = label + @id = Grumlin::Typing.cast(id) + @inVLabel = inVLabel + @outVLabel = outVLabel + @inV = Grumlin::Typing.cast(inV) + @outV = Grumlin::Typing.cast(outV) + end - def ==(other) - self.class == other.class && @label == other.label && @id == other.id - end + def ==(other) + self.class == other.class && @label == other.label && @id == other.id + end - def inspect - "e[#{@id}][#{@outV}-#{@label}->#{@inV}]" - end + def inspect + "e[#{@id}][#{@outV}-#{@label}->#{@inV}]" + end - def to_s - inspect - end + def to_s + inspect end end