Project

General

Profile

Feature #4818

Add method marshalable?

Added by yimutang (Joey Zhou) over 9 years ago. Updated about 3 years ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:36707]

Description

Some objects can not be marshaled. Maybe there should be a method to tell it.

hash = Hash.new {|h,k| k * 2}

this hash can't be marshaled because it has a default proc. If existing such method:

Marshal.marshalable?(hash) #=> method "Marshal.marshalable?"
hash.marshalable? #=> method "Kernel#marshalable?"

If you think the method name hard to spell, maybe get a synonym "dumpable?"


Related issues

Has duplicate Ruby master - Feature #16240: Are all objects and methods marshalableRejectedActions

Also available in: Atom PDF