Class: Rant::RantVar::Constraints::Integer
- Includes:
- Constraint
- Defined in:
- lib/rant/import/var/numbers.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.rant_constraint(range = nil) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rant/import/var/numbers.rb', line 14 def rant_constraint(range = nil) if range IntegerInRange.new(range) else self.new end end |
Instance Method Details
#default ⇒ Object
28 29 30 |
# File 'lib/rant/import/var/numbers.rb', line 28 def default 0 end |
#filter(val) ⇒ Object
23 24 25 26 27 |
# File 'lib/rant/import/var/numbers.rb', line 23 def filter(val) Kernel::Integer(val) rescue raise ConstraintError.new(self, val) end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/rant/import/var/numbers.rb', line 31 def to_s "integer" end |