Created
March 28, 2010 20:00
-
-
Save knzai/346989 to your computer and use it in GitHub Desktop.
decomposed methods versus implementation methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def can_checkout_movie? | |
account_is_current? && | |
available_rental_slots? && | |
late_fees_within_limit? | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def can_checkout_movie? | |
(Date.today - account.last_membership_renewal_date) > vendor.membership_period && | |
movies.currently_checked_out < max_movies_rentable && | |
account.late_fees < (account.is_premium? ? vendor.max_late_fees_for_premium_account : vendor.max_late_fees_for_regular_account) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment