The Complete Guide to Create a Copy of an Object in Ruby: Part I

Mehdi Farsi
Jan 4 · 3 min read

Introduction

Shallow copy vs. Deep copy

Shallow copy

Deep copy

dup and clone methods

Object#dup

initialize copy

Object#clone

clone vs dup

Object#freeze

Object#extend

Object-level methods

Part II

ONE MORE THING ⬇

Feel free to subscribe here: www.rubycademy.com


rubycademy

E-Learning platform for Ruby and Ruby on Rails

Mehdi Farsi

Written by

Founder of www.rubycademy.com — I blog about Ruby & ROR - Paris

rubycademy

E-Learning platform for Ruby and Ruby on Rails