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

Version Path
arstotzka-1.4.2 spec/support/models/star.rb
arstotzka-1.4.1 spec/support/models/star.rb
arstotzka-1.4.0 spec/support/models/star.rb
arstotzka-1.3.2 spec/support/models/star.rb
arstotzka-1.3.1 spec/support/models/star.rb
arstotzka-1.3.0 spec/support/models/star.rb
arstotzka-1.2.4 spec/support/models/star.rb
arstotzka-1.2.3 spec/support/models/star.rb
arstotzka-1.2.2 spec/support/models/star.rb
arstotzka-1.2.1 spec/support/models/star.rb
arstotzka-1.2.0 spec/support/models/star.rb