Sha256: d56e77aa0169a77982e9ae7ec5d7a48f1b6b0965942129dd29f6ae73e0aec0c8
Contents?: true
Size: 326 Bytes
Versions: 6
Compression:
Stored size: 326 Bytes
Contents
# frozen_string_literal: true class Star attr_reader :name, :color def initialize(name:, color: 'yellow') @name = name @color = color end def yellow? color == 'yellow' end def ==(other) return false unless other.is_a?(self.class) other.color == color && other.name == name end end
Version data entries
6 entries across 6 versions & 1 rubygems