class CloseNeighbourhood

Public Class Methods

new(center, width) click to toggle source
# File lib/cartesius/neighbourhoods.rb, line 13
def initialize(center, width)
  @center = center
  @width = width
end

Public Instance Methods

include?(value) click to toggle source
# File lib/cartesius/neighbourhoods.rb, line 18
def include?(value)
  (value >= @center - @width) && (value <= @center + @width)
end