class ViewModel def initialize(klass) @klass = klass end private attr_accessor :klass def method_missing(method_sym, *arguments, &block) klass.send(method_sym, *arguments, &block) end def respond_to?(method_sym) return true if methods.include?(method_sym) return true if klass.methods.include?(method_sym) false end def methods self.class.instance_methods + klass.methods end end