How can I use delegate to delegate a static method?
I am trying to do the following
e.g.
class MyThing
def some_instance_method(a, b)
something.some_instance_method(a, b)
end
def some_static_method(a, b)
User.some_static_method(a, b)
end
end
# can you write it this way???
class MyThing
delegate :some_instance_method, :to => :something
delegate :some_static_method, :to => User
end
class MyThing
class << self
delegate :some_static_method, :to => :User
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With