Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

method_missing is great if you're wrapping an object

    class Wrapper < BasicObject
      def initialize(obj)
        @obj = obj
      end

      def method_missing(name, *, **, &)
        ::Kernel.puts "Calling #{name}"
        @obj.send(name, *, **, &)
      end
    end





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: