Last active
December 27, 2018 13:27
-
-
Save jinhucheung/dcba2ee5fd440990e43786ca5284722e to your computer and use it in GitHub Desktop.
Revisions
-
jinhucheung revised this gist
Dec 27, 2018 . 2 changed files with 8 additions and 2 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 @@ -17,4 +17,7 @@ def post def delete puts 'delete!' end end Postman.post #=> 'post!' Postman.delete #=> 'delete!' 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 @@ -14,4 +14,7 @@ def post def delete puts 'delete!' end end Postman.post #=> 'post!' Postman.delete #=> 'delete!' -
jinhucheung revised this gist
Dec 27, 2018 . No changes.There are no files selected for viewing
-
jinhucheung created this gist
Dec 27, 2018 .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 @@ require 'singleton' require 'forwardable' class Postman include Singleton class << self extend Forwardable def_delegators :instance, :post, :delete end def post puts 'post!' end def delete puts 'delete!' 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,17 @@ require 'singleton' class Postman include Singleton class << self delegate :post, :delete, to: :instance end def post puts 'post!' end def delete puts 'delete!' end end