Skip to content

Commit

Permalink
refactor: range를 companion object로 추출
Browse files Browse the repository at this point in the history
  • Loading branch information
sjjeong committed Jan 20, 2025
1 parent 5b3d260 commit c665edb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/lotto/domain/LottoNumber.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package lotto.domain
@JvmInline
value class LottoNumber(val number: Int) {
init {
require(number in START_LOTTO_NUMBER..END_LOTTO_NUMBER)
require(number in lottoNumberRange)
}

companion object {
const val START_LOTTO_NUMBER = 1
const val END_LOTTO_NUMBER = 45
val lottoNumberRange = START_LOTTO_NUMBER..END_LOTTO_NUMBER
}
}

0 comments on commit c665edb

Please sign in to comment.