Class: Range — Documentation by YARD 0.9.44

# Class: Range

Inherits:
  Object
  - Object
  - Range
  show all

Defined in:
  lib/unisec/utils.rb

## Instance Method Summary collapse

- #include_range?(range) ⇒ TrueClass|FalseClass

  Is a range included in another range? Are all values of range B included in range A?.

## Instance Method Details

### #include_range?(range) ⇒ `TrueClass|FalseClass`

Is a range included in another range? Are all values of range B included in range A?

#### Examples:

    (1..10).include_range?(2..11) # => false
    (1..10).include_range?(2..4) # => true

Parameters:

- range (`Range`)

Returns:

- (`TrueClass|FalseClass`)

    47
    48
    49
    # File 'lib/unisec/utils.rb', line 47

    def include_range?(range)
      self.begin <= range.begin && self.end >= range.end
    end