4 # DelegatedMethod is used to implement Module#define_method
6 class DelegatedMethod < RuntimePrimitive
11 self.instance_fields = 7
13 def name= n; @name = n end
19 def self.build(sym, receiver, pass_self)
21 obj.name = "<delegated to: #{receiver.to_s}>"
22 obj.put RuntimePrimitive::PrimitiveIndex, :dispatch_as_method
23 obj.put RuntimePrimitive::RequiredArguments, -1
24 obj.put RuntimePrimitive::SerialNumber, 0
25 obj.put RuntimePrimitive::ByteCodes, sym
26 obj.put Receiver, receiver
27 obj.put UseSelf, pass_self # If true, first argument will be 'self'
31 def activate(recv, mod, args)
34 out = Rubinius.asm(recv, mod, args, sz) do |r,m,a,s|