Created
August 21, 2020 20:01
-
-
Save alxlion/1796084d7f96f67276735abd027f8f06 to your computer and use it in GitHub Desktop.
Define_method Metaprogramming example
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 Shipment | |
define_method :cancel do |reason| | |
@cancelled = true | |
puts reason | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment