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
| # frozen_string_literal: true | |
| require "active_support/core_ext/object/duplicable" | |
| class Object | |
| # Returns a deep copy of object if it's duplicable. If it's | |
| # not duplicable, returns +self+. | |
| # | |
| # object = Object.new | |
| # dup = object.deep_dup |
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
| #!/usr/bin/env ruby | |
| class MegaGreeter | |
| attr_accessor :names | |
| # Create the object | |
| def initialize(names = "World") | |
| @names = names | |
| 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
| 0x2A7cA37316e589E2E58C610C41C76cf33E063f39 |
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
| 0xb4AaE55A71a023138E703216708BA78fb1281f18 |