Module: ImgToPdf::IntegerParser

Extended by:
IntegerParser
Included in:
IntegerParser
Defined in:
lib/img_to_pdf/integer_parser.rb

Instance Method Summary collapse

Instance Method Details

#call(s) ⇒ Object



6
7
8
9
10
11
# File 'lib/img_to_pdf/integer_parser.rb', line 6

def call(s)
  md = /\A\d+\z/.match(s)
  raise ImgToPdf::ParserError, "invalid integer: #{s.inspect}" if !md

  return s.to_i
end