module Constraints

Public Instance Methods

bounded?(data, min=nil, max=nil) click to toggle source
# File lib/taxon/constraints.rb, line 3
def bounded?(data, min=nil, max=nil)
  if ((min==nil)&&(max==nil))
    true
  elsif (min==nil)
    data <= max
  elsif (max==nil)
    data >= min
  else
    (data <= max) && (data >= min)
  end
end
upper_bounded?(data, max=nil) click to toggle source
# File lib/taxon/constraints.rb, line 15
def upper_bounded?(data, max=nil)
  max==nil ? true : data <= max
end