Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Created January 25, 2016 10:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikecmpbll/90ddc01c9c93f1db66e7 to your computer and use it in GitHub Desktop.
Save mikecmpbll/90ddc01c9c93f1db66e7 to your computer and use it in GitHub Desktop.
class Whatever
attr_accessor :error
def grava_lead(attrs)
if some_condition
@error = "Some error"
return false
end
# ...
end
end
w = Whatever.new
if w.grava_lead(attrs)
# success
else
w.error # => "Some error"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment