Sha256: 11627aa8118b049d7c255e651d83c36b6acf252f14e908ef108a617997d2d482
Contents?: true
Size: 385 Bytes
Versions: 22
Compression:
Stored size: 385 Bytes
Contents
# frozen_string_literal: true class Face attr_accessor :v1, :v2, :v3 def initialize(v1, v2, v3) @v1 = v1 @v2 = v2 @v3 = v3 end def to_s return nil unless !v1.nil? && !v2.nil? && !v3.nil? "f #{v1.index} #{v2.index} #{v3.index}" end def rand_attr [:v1, :v2, :v3].sample end def fuck(new_vertex) send("#{rand_attr}=", new_vertex) end end
Version data entries
22 entries across 22 versions & 1 rubygems