Sha256: d416ba71afe9baec9d0df2529f64c0ad1786f43cf80fb80b2489e46840090d51

Contents?: true

Size: 596 Bytes

Versions: 4

Compression:

Stored size: 596 Bytes

Contents

module SPNet

# Defines a limit, where a value should not be above (for upper limit) or below
# (for lower limit). If inclusive is set to true, the limit indicates that values
# at the limit are OK.
#
# @author James Tunnell
class Limit
  attr_reader :value, :inclusive
  
  def inclusive?
    return @inclusive
  end
  
  def initialize value, inclusive
    @value = value
    @inclusive = inclusive
  end
end

# Base class for limiting values. Does nothing on it's own.
#
# @author James Tunnell
class Limiter
  def apply_limit value, current_value
    raise NotImplementedError
  end
end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spnet-0.1.8 lib/spnet/core/limiter.rb
spnet-0.1.7 lib/spnet/core/limiter.rb
spnet-0.1.6 lib/spnet/core/limiter.rb
spnet-0.1.5 lib/spnet/core/limiter.rb