Last active
July 31, 2016 16:47
-
-
Save mustmodify/6cd83302af144a344694efc0ceed930a to your computer and use it in GitHub Desktop.
obviously not ok... .
This file contains 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 characters
def fire | |
obj = Model.new | |
obj.add_blank_parts | |
return obj.to_html | |
end |
This file contains 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 characters
module HasReplacementParts | |
def add_blank_replacement_parts | |
#... | |
end | |
included do | |
if method_defined? :add_blank_parts | |
alias_method :old_add_blank_parts, :add_blank_parts | |
define_method :add_blank_parts do | |
old_add_blank_parts | |
add_blank_replacement_parts | |
end | |
else | |
alias_method :add_blank_parts, :add_blank_replacement_parts | |
end | |
end | |
end |
This file contains 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 characters
module HasReturnedParts | |
def add_blank_returned_parts | |
#... | |
end | |
included do | |
if method_defined? :add_blank_parts | |
alias_method :old_add_blank_parts, :add_blank_parts | |
define_method :add_blank_parts do | |
old_add_blank_parts | |
add_blank_returned_parts | |
end | |
else | |
alias_method :add_blank_parts, :add_blank_returned_parts | |
end | |
end | |
end |
This file contains 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 characters
class Report | |
include HasReturnedParts | |
include HasReplacementParts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment