📝 상세 설명
- 동작임에도 Property로 선언한 이유에 대해 고민합니다.
class CostSummary(userCurrency: Currency) {
private val _lines = mutableListOf<CurrencyConversion>()
val total: Money = Money.of(0, userCurrency)
private set
val lines: List<CurrencyConversion> // 왜 동작임에도 Property로 선언했을까?
get() = _lines.toList()
fun addLine(line: CurrencyConversion) {
_lines.add(line)
total += line.toMoney
}
}
Originally posted by @white-gyu in #24 (comment)
📝 상세 설명
Originally posted by @white-gyu in #24 (comment)