Actions
Bug #12251
closedDelegateClass(OpenStruct) behavior in 2.3.0 different from 2.2
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
Description
This came from https://github.com/ruby-grape/grape/issues/1348
require 'delegate'
require 'ostruct'
class AttributeTranslator < DelegateClass(OpenStruct)
def initialize(attributes = {})
ostruct = OpenStruct.new(attributes)
super ostruct
end
end
def namespace
'foobar'
end
instance = AttributeTranslator.new(namespace: '/')
puts instance.namespace
Ruby 2.2.1
=> '/'
Ruby 2.3.0
=> 'foobar'
Halp?
Actions
Like0
Like0Like0Like0Like0