Hola
tengo estos dos metodos de clase
priceBeforeTax
| com p p2 |
com := self isBestSeller
ifTrue: [ price / 50 ]
ifFalse: [ price / 100 ].
p := self isBestSeller
ifTrue: [ price * 1.1 ]
ifFalse: [ price ].
p2 := p + com.
^ p2
-----------------------------------------------------------
price
| com p p2 p3 |
self isBestSeller
ifTrue: [ p := price * 1.1.
com := price / 50 ]
ifFalse: [ p := price.
com := price / 100 ].
p2 := p + (p * 21 / 100).
p3 := p2 + com.
^ p3
como se ve hay codigo repetido quiero si pueden me ayuden a refactorizar estos dos metodos
--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To view this discussion on the web visit
https://groups.google.com/d/msgid/va-smalltalk/a13309b7-1e54-4e99-b473-d79346f65891%40googlegroups.com.