Class: SPNet::Limit

Inherits:
Object
  • Object
show all
Defined in:
lib/spnet/core/limiter.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, inclusive) ⇒ Limit

Returns a new instance of Limit.



15
16
17
18
# File 'lib/spnet/core/limiter.rb', line 15

def initialize value, inclusive
  @value = value
  @inclusive = inclusive
end

Instance Attribute Details

#inclusiveObject (readonly)

Returns the value of attribute inclusive.



9
10
11
# File 'lib/spnet/core/limiter.rb', line 9

def inclusive
  @inclusive
end

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/spnet/core/limiter.rb', line 9

def value
  @value
end

Instance Method Details

#inclusive?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/spnet/core/limiter.rb', line 11

def inclusive?
  return @inclusive
end