Sha256: 812bc5173be5b8e9a7126856c174a8fd5cbf313bec577c97b733d6780fc13492

Contents?: true

Size: 318 Bytes

Versions: 6

Compression:

Stored size: 318 Bytes

Contents

# frozen_string_literal: true

module Strava
  module DeepCopyable
    #
    # Ruby's way of creating a true deep copy/clone
    #
    # @param [Object] obj of any kind
    #
    # @return [Object] deep clone of what was passed into
    #
    def deep_copy(obj)
      Marshal.load(Marshal.dump(obj))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
strava-ruby-client-2.2.0 lib/strava/deep_copyable.rb
strava-ruby-client-2.1.0 lib/strava/deep_copyable.rb
strava-ruby-client-2.0.0 lib/strava/deep_copyable.rb
strava-ruby-client-1.1.0 lib/strava/deep_copyable.rb
strava-ruby-client-1.0.1 lib/strava/deep_copyable.rb
strava-ruby-client-1.0.0 lib/strava/deep_copyable.rb