Skip to content

Instantly share code, notes, and snippets.

@luckydev
Last active August 29, 2015 14:02
Show Gist options
  • Save luckydev/549d2749565c4638ecf3 to your computer and use it in GitHub Desktop.
Save luckydev/549d2749565c4638ecf3 to your computer and use it in GitHub Desktop.
Define method
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