Sha256: 5f8191e1cf47e6dbbb78087a695d2cb0e7a7966751bc7626b34fc17857deb156
Contents?: true
Size: 325 Bytes
Versions: 11
Compression:
Stored size: 325 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
11 entries across 11 versions & 1 rubygems