Last active
September 12, 2016 18:35
-
-
Save finbarr/256dfc298818fb34ce5110bb90bee14e to your computer and use it in GitHub Desktop.
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 SegmentService | |
def self.safe_method(name, &blk) | |
define_method name do |*args| | |
begin | |
instance_exec *args, &blk | |
rescue | |
Rails.logger.info "Rescued #{name}" | |
end | |
end | |
end | |
safe_method :record_event do |event_name, params| | |
# method body goes here | |
raise | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment