Last active
August 29, 2015 14:12
-
-
Save mrkplt/35d6d1df5b0105fdd577 to your computer and use it in GitHub Desktop.
Revisions
-
mrkplt revised this gist
Jan 6, 2015 . 2 changed files with 6 additions and 6 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 @@ -32,4 +32,4 @@ def failure raise LambdaError, 'A lambda for failure must be provided' end 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 @@ -1,10 +1,10 @@ class SaveObjekt < BusinessObject def initialize(objekt, lambdas) @objekt = objekt super(lambdas) end def perform !@objekt.nil? ? success : failure end end -
mrkplt revised this gist
Jan 6, 2015 . 1 changed file with 1 addition 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 @@ -1,4 +1,4 @@ class SaveObjekt < BusinessObject def intialize(some_objekt, lambda_hash) @objekt = some_objekt super(lambda_hash) -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 3 additions and 3 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 @@ -12,9 +12,9 @@ def perform private def post_init(lambda_hash) @success = lambda_hash[:success] @failure = lambda_hash[:failure] end def success -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 4 additions and 6 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 @@ -12,24 +12,22 @@ def perform private def post_init(args) @success = args[:success] @failure = args[:failure] end def success begin @success.call rescue NoMethodError raise LambdaError, 'A lambda for success must be provided' end end def failure begin @failure.call rescue NoMethodError raise LambdaError, 'A lambda for failure must be provided' end -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 2 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 @@ -1,7 +1,7 @@ def SaveObjekt < BusinessObject def intialize(some_objekt, lambda_hash) @objekt = some_objekt super(lambda_hash) end def perform -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 10 additions and 4 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 @@ -1,11 +1,17 @@ class BusinessObject class LambdaError < StandardError; end; class NotImplementedError < StandardError; end; def initialize(lambda_hash = {}) post_init(lambda_hash) end def perform raise NotImplementedError, 'must implement perform.' end private attr_reader :success_lambda, :failure_lambda def post_init(args) @@ -20,7 +26,7 @@ def success raise LambdaError, 'A lambda for success must be provided' end end def failure begin failure_lambda.call -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 1 addition 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 @@ -8,7 +8,7 @@ def initialize(*args) attr_reader :success_lambda, :failure_lambda def post_init(args) @success_lambda = args[:success] @failure_lambda = args[:failure] end -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 1 addition 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 @@ -1,7 +1,7 @@ class BusinessObject class LambdaError < StandardError; end; def initialize(*args) post_init(args) end private -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 11 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 @@ -1,4 +1,5 @@ class BusinessObject class LambdaError < StandardError; end; def initialize(*args) post_init(*args) end @@ -13,10 +14,18 @@ def post_init(*args) end def success begin success_lambda.call rescue NoMethodError raise LambdaError, 'A lambda for success must be provided' end end def failure begin failure_lambda.call rescue NoMethodError raise LambdaError, 'A lambda for failure must be provided' end end end -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 1 addition 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 @@ -1,7 +1,7 @@ class BusinessObject def initialize(*args) post_init(*args) end private -
mrkplt revised this gist
Jan 5, 2015 . 2 changed files with 1 addition 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 @@ -1,5 +1,5 @@ class BusinessObject def initialize(*args) post_init(*args) end File renamed without changes. -
mrkplt revised this gist
Jan 5, 2015 . 1 changed file with 10 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,10 @@ def SaveObjekt < BusinessObject def intialize(some_objekt, *args) @objekt = some_objekt super(*args) end def perform @objekt.action ? success : failure end end -
mrkplt created this gist
Jan 5, 2015 .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,22 @@ class BusinessObject def initialize(*args) post_init(*args) end private attr_reader :success_lambda, :failure_lambda def post_init(*args) @success_lambda = args[:success] @failure_lambda = args[:failure] end def success success_lambda.call end def failure failure_lambda.call end end