Project

General

Profile

Bug #15808 ยป forwardable_bug.rb

kyrylo (Kyrylo Silin), 04/28/2019 04:01 PM

 
require 'forwardable'
require 'ostruct'

class A
extend Forwardable
def_delegators :@foo, :print, :bar

def initialize(foo)
@foo = foo
end
end

obj = A.new(OpenStruct.new(print: 123, bar: 456))

p "print - #{obj.print}; bar - #{obj.bar}"
    (1-1/1)