Skip to content

Commit ec6d601

Browse files
committed
Add object_id to protected methods
1 parent aa52ad1 commit ec6d601

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/ostruct.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ def new_ostruct_member!(name) # :nodoc:
254254
private def is_method_protected!(name) # :nodoc:
255255
if !respond_to?(name, true)
256256
false
257+
elsif name.match?(/^object_id$/)
258+
true
257259
elsif name.match?(/!$/)
258260
true
259261
else

0 commit comments

Comments
 (0)