Last active
August 29, 2015 14:11
-
-
Save mrkplt/cbc4c01038be533a43df to your computer and use it in GitHub Desktop.
Revisions
-
mrkplt renamed this gist
Jan 5, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mrkplt created this gist
Dec 9, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ 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