Last active
August 29, 2015 14:02
-
-
Save luckydev/549d2749565c4638ecf3 to your computer and use it in GitHub Desktop.
Define method
This file contains 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
class Order | |
attr_accessor :amount | |
def amount=(given_amount) | |
#write your logic here | |
end | |
end | |
order = Order.new | |
order.amount = 45 | |
# the value 45 will be passed in given_amount variable in that | |
# overriden method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment