Class: Xcflushd::GLIHelpers::PositiveMinMaxInt
- Inherits:
-
Object
- Object
- Xcflushd::GLIHelpers::PositiveMinMaxInt
- Defined in:
- lib/xcflushd/gli_helpers.rb
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(min, max) ⇒ PositiveMinMaxInt
constructor
A new instance of PositiveMinMaxInt.
- #to_a ⇒ Object
Constructor Details
#initialize(min, max) ⇒ PositiveMinMaxInt
Returns a new instance of PositiveMinMaxInt.
23 24 25 |
# File 'lib/xcflushd/gli_helpers.rb', line 23 def initialize(min, max) @min, @max = min, max end |
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
21 22 23 |
# File 'lib/xcflushd/gli_helpers.rb', line 21 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
21 22 23 |
# File 'lib/xcflushd/gli_helpers.rb', line 21 def min @min end |
Class Method Details
.match(str) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/xcflushd/gli_helpers.rb', line 13 def self.match(str) md = POSITIVE_MIN_MAX_RE.match str return false if md.nil? min, max = [md[:min].to_i, md[:max].to_i] return false if max < min new min, max end |
Instance Method Details
#to_a ⇒ Object
27 28 29 |
# File 'lib/xcflushd/gli_helpers.rb', line 27 def to_a [self] end |