Class: ImageOptim::NonNegativeIntegerRange
- Inherits:
-
Object
- Object
- ImageOptim::NonNegativeIntegerRange
- Defined in:
- lib/image_optim/non_negative_integer_range.rb
Overview
Denote range of non negative integers for worker option
Class Method Summary collapse
-
.add_to_option_parser(option_parser) ⇒ Object
Add handling of range of non negative integers in OptionParser instance.
Class Method Details
.add_to_option_parser(option_parser) ⇒ Object
Add handling of range of non negative integers in OptionParser instance
7 8 9 10 11 |
# File 'lib/image_optim/non_negative_integer_range.rb', line 7 def self.add_to_option_parser(option_parser) option_parser.accept(self, /(\d+)(?:-|\.\.)(\d+)/) do |_, m, n| m.to_i..n.to_i end end |