Module: Contracts::Invariants::InvariantExtension
- Defined in:
- lib/contracts-ruby2/lib/contracts/invariants.rb,
lib/contracts-ruby3/lib/contracts/invariants.rb
Instance Method Summary collapse
Instance Method Details
#invariant(name, &condition) ⇒ Object
26 27 28 29 30 |
# File 'lib/contracts-ruby2/lib/contracts/invariants.rb', line 26 def invariant(name, &condition) return if ENV["NO_CONTRACTS"] invariants << Invariant.new(self, name, &condition) end |
#invariants ⇒ Object
32 33 34 |
# File 'lib/contracts-ruby2/lib/contracts/invariants.rb', line 32 def invariants @invariants ||= [] end |