Class: Contracts::Builtin::RangeOf
- Inherits:
-
CallableClass
- Object
- CallableClass
- Contracts::Builtin::RangeOf
- Defined in:
- lib/contracts/builtin_contracts.rb
Overview
Use this to specify a Range object of a particular datatype. Example: RangeOf[Nat]
, RangeOf[Date]
, …
Instance Method Summary collapse
-
#initialize(contract) ⇒ RangeOf
constructor
A new instance of RangeOf.
- #to_s ⇒ Object
- #valid?(val) ⇒ Boolean
Methods inherited from CallableClass
Constructor Details
#initialize(contract) ⇒ RangeOf
Returns a new instance of RangeOf.
366 367 368 369 |
# File 'lib/contracts/builtin_contracts.rb', line 366 def initialize(contract) super() @contract = contract end |
Instance Method Details
#to_s ⇒ Object
377 378 379 |
# File 'lib/contracts/builtin_contracts.rb', line 377 def to_s "a range of #{@contract}" end |