Class: Obj
- Inherits:
-
Object
- Object
- Obj
- Includes:
- Contracts
- Defined in:
- lib/contracts-ruby2/benchmarks/invariants.rb,
lib/contracts-ruby3/benchmarks/invariants.rb
Constant Summary
Constants included from Contracts
Constants included from Contracts::Builtin
Contracts::Builtin::ArrayOf, Contracts::Builtin::SetOf
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #contracts_add(a, b) ⇒ Object
-
#initialize(value) ⇒ Obj
constructor
A new instance of Obj.
Methods included from Contracts
Methods included from Contracts::Attrs
#attr_accessor_with_contract, #attr_reader_with_contract, #attr_writer_with_contract
Constructor Details
#initialize(value) ⇒ Obj
Returns a new instance of Obj.
11 12 13 |
# File 'lib/contracts-ruby2/benchmarks/invariants.rb', line 11 def initialize value @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/contracts-ruby2/benchmarks/invariants.rb', line 10 def value @value end |
Instance Method Details
#contracts_add(a, b) ⇒ Object
16 17 18 |
# File 'lib/contracts-ruby2/benchmarks/invariants.rb', line 16 def contracts_add a, b a + b end |