Class: SPNet::Limit
- Inherits:
-
Object
- Object
- SPNet::Limit
- 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
-
#inclusive ⇒ Object
readonly
Returns the value of attribute inclusive.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #inclusive? ⇒ Boolean
-
#initialize(value, inclusive) ⇒ Limit
constructor
A new instance of Limit.
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
#inclusive ⇒ Object (readonly)
Returns the value of attribute inclusive.
9 10 11 |
# File 'lib/spnet/core/limiter.rb', line 9 def inclusive @inclusive end |
#value ⇒ Object (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
11 12 13 |
# File 'lib/spnet/core/limiter.rb', line 11 def inclusive? return @inclusive end |