Skip to content

Instantly share code, notes, and snippets.

@Groogy
Last active October 2, 2017 10:28
Show Gist options
  • Save Groogy/75d5b5458d14ba689bb740283977bf6c to your computer and use it in GitHub Desktop.
Save Groogy/75d5b5458d14ba689bb740283977bf6c to your computer and use it in GitHub Desktop.
class Foo
include CrystalClear
def on_contract_fail(contract, condition, method) # some args with info
# Default behaviour but you can overide it in this method
raise CrystalClear::ContractError.new("Failed #{self.class} #{contract} contract: #{condition}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment