Project

General

Profile

Actions

Bug #6028

closed

OpenStruct.dup doesn't have all its methods

Added by marcandre (Marc-Andre Lafortune) about 12 years ago. Updated about 12 years ago.

Status:
Closed
Target version:
ruby -v:
r34609
Backport:
[ruby-core:42647]

Description

Dupped OpenStructs don't have the same methods.

x = OpenStuct.new(foo: 42)
x.dup.methods == x.methods # => false
x.respond_to?(:foo) # => true
x.dup.respond_to?(:foo) # => false
Actions

Also available in: Atom PDF

Like0
Like0