Last active
          August 29, 2015 13:57 
        
      - 
      
 - 
        
Save stephenaument/9422568 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
stephenaument revised this gist
Mar 10, 2014 . 6 changed files with 21 additions and 17 deletions.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 @@ -3,17 +3,14 @@ def name 'Demo Duck' end def status 'sleeping' end def color 'gray' end def migratory? true end 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 @@ -7,17 +7,14 @@ def name 'Demo Duck' end def status 'sleeping' end def color 'gray' end def migratory? true end 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 @@ -3,22 +3,18 @@ def name 'Demo Duck' end def status 'sleeping' end def color 'gray' end def migratory? true end def method_missing(name, *args) super unless Duck.new.respond_to?(name) name.ends_with?('?') ? false : nil 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 @@ -3,17 +3,14 @@ def name 'Demo Goose' end def status 'awake' end def color 'black' end def migratory? true end 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 @@ -3,22 +3,18 @@ def name 'Demo Goose' end def status 'awake' end def color 'black' end def migratory? true end def method_missing(name, *args) super unless Goose.new.respond_to?(name) name.ends_with?('?') ? false : nil end 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,21 @@ class NilGoose < NilObject def initialize super(Goose) end def name 'Demo Goose' end def status 'awake' end def color 'black' end def migratory? true end end  - 
        
stephenaument revised this gist
Mar 10, 2014 . 1 changed file with 24 additions and 0 deletions.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,24 @@ class NilDuck < NilObject def initialize super(Duck) end def name 'Demo Duck' end def status 'sleeping' end def color 'gray' end def migratory? true end end  - 
        
stephenaument revised this gist
Mar 7, 2014 . 3 changed files with 47 additions and 1 deletion.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 @@ -20,6 +20,7 @@ def migratory? def method_missing(name, *args) super unless Duck.new.respond_to?(name) name.ends_with?('?') ? false : nil end end 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,20 @@ class NilGoose < NilObject def name 'Demo Goose' end def status 'awake' end def color 'black' end def migratory? true end end 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,25 @@ class NilGoose def name 'Demo Goose' end def status 'awake' end def color 'black' end def migratory? true end def method_missing(name, *args) super unless Goose.new.respond_to?(name) name.ends_with?('?') ? false : nil end end  - 
        
stephenaument revised this gist
Mar 7, 2014 . 3 changed files with 49 additions and 0 deletions.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,25 @@ class NilDuck def name 'Demo Duck' end def status 'sleeping' end def color 'gray' end def migratory? true end def method_missing(name, *args) Duck.new.respond_to?(name) ? nil : super end end 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,10 @@ class NilObject def initialize(klass) @klass = klass end def method_missing(name, *args) return super unless @klass.new.respond_to?(name) name.to_s.ends_with?('?') ? false : nil end end 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,14 @@ class NilObject def initialize(klass=nil) @klass = klass || real_class_name end def method_missing(name, *args) return super unless @klass.new.respond_to?(name) name.to_s.ends_with?('?') ? false : nil end def real_class_name self.class.name[3..-1].constantize end end  - 
        
stephenaument created this gist
Mar 7, 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,20 @@ class NilDuck < NilObject def name 'Demo Duck' end def status 'sleeping' end def color 'gray' end def migratory? true end end 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,18 @@ class NilObject def initialize(klass=nil) @klass = klass || real_class_name end def method_missing(name, *args) return super unless respond_to?(name) name.to_s.ends_with?('?') ? false : nil end def respond_to?(name) @klass.new.respond_to?(name) end def real_class_name self.class.name[3..-1].constantize end end