class ArgumentSpecification::Matchers::BeWithinRange

Attributes

range[R]

Public Class Methods

new(range) click to toggle source

Create a new matcher instance

Arguments:

range: (Range)

Example:

>> ArgumentSpecification::Matchers::BeWithinRange.new(1..10)
=> #<ArgumentSpecification::Matchers::BeWithinRange:0x00000000000000 @range=1..10>
# File lib/argspec/matchers/be_within_range.rb, line 17
def initialize(range)
  @range = range
end

Public Instance Methods

matches?() click to toggle source

Check if the actual object matches

Example:

>> matcher.matches?
=> true
# File lib/argspec/matchers/be_within_range.rb, line 27
def matches?
  @range.include?(@actual)
end