Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Created March 2, 2016 19:59
Show Gist options
  • Save BanzaiMan/177854ba69e551fce65d to your computer and use it in GitHub Desktop.
Save BanzaiMan/177854ba69e551fce65d to your computer and use it in GitHub Desktop.
require 'ostruct'
job = OpenStruct.new( :state => 'failed')
def debug_data
{
previous_state: job.state
}
end
debug_data # NameError on `job`!
@BanzaiMan
Copy link
Author

Obviously, one can pass an arg to #debug_data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment