resources/memory/memory_range.rb
def constrain(size)
    if size < @floor
      @floor
    else
      @ceiling && size > @ceiling ? @ceiling : size
    end
  end
# Constrains a given memory size to this range. If the size falls within the range, returns the size.
# If the size is below the range, return the floor of the range. If the size is above the range,
# return the ceiling of the range.
#
# @param [MemorySize] size the memory size to be constrained
# @return [MemorySize] the constrained memory size
Constrains a given memory size to this range. If the size falls within the range, returns the size.
If the size is below the range, return the floor of the range. If the size is above the range,
return the ceiling of the range.
Constrains a given memory size to this range . If the size falls within the range returns the size . If the size is below the range return the floor of the range . If the size is above the range return the ceiling of the range .
def constrain(size)
    if size < @floor
      @floor
    else
      @ceiling && size > @ceiling ? @ceiling : size
    end
  end
def constrain ( size ) if size < @floor @floor else @ceiling && size > @ceiling ? @ceiling : size end end
Constrains a given memory size to this range.
Constrains a given memory size to this range .
the constrained memory size
the constrained memory size
MemorySize
size
size the memory size to be constrained
size the memory size to be constrained