Sha256: b0e0e444d69b25ba73a20a92f04f51bf89930dffbda7ef219881855e80f8c75f

Contents?: true

Size: 363 Bytes

Versions: 4

Compression:

Stored size: 363 Bytes

Contents

module SoberSwag
  module Reporting
    module Input
      ##
      # Parse some kind of number.
      class Number < Base
        def call(input)
          return Report::Value.new(['is not a number']) unless input.is_a?(Numeric)

          input
        end

        def swagger_schema
          [{ type: 'number' }, {}]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sober_swag-0.24.1 lib/sober_swag/reporting/input/number.rb
sober_swag-0.24.0 lib/sober_swag/reporting/input/number.rb
sober_swag-0.23.0 lib/sober_swag/reporting/input/number.rb
sober_swag-0.22.0 lib/sober_swag/reporting/input/number.rb