Method: Linecook::Recipe#_clone_
- Defined in:
- lib/linecook/recipe.rb
#_clone_ ⇒ Object
Returns a clone of self, kind of like Object#clone.
Note that unlike Object.clone this currently does not carry forward tainted/frozen state, nor can it carry forward singleton methods. Modules and internal state only.
119 120 121 122 123 124 |
# File 'lib/linecook/recipe.rb', line 119 def _clone_ clone = _class_.allocate clone._initialize_clone_(self) _singleton_class_.included_modules.each {|mod| clone._extend_ mod } clone end |