Class: Contracts::Constraints::Range
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(range) ⇒ Range
constructor
A new instance of Range.
- #matches?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(range) ⇒ Range
Returns a new instance of Range.
240 |
# File 'lib/contracts.rb', line 240 def initialize(range) = @range = range |
Instance Method Details
#description ⇒ Object
242 |
# File 'lib/contracts.rb', line 242 def description = "in #{@range.inspect}" |
#matches?(value) ⇒ Boolean
241 |
# File 'lib/contracts.rb', line 241 def matches?(value) = @range.cover?(value) |