Sha256: c4d4a936a56004f3959b585ac9bc29c7e673afb6e9de639645153127124086f6

Contents?: true

Size: 355 Bytes

Versions: 7

Compression:

Stored size: 355 Bytes

Contents

module SoberSwag
  module Reporting
    module Input
      ##
      # Convert booleans.
      class Bool < Base
        def call(val)
          return Report::Value.new(['was not a bool']) unless [true, false].include?(val)

          val
        end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sober_swag-0.25.2 lib/sober_swag/reporting/input/bool.rb
sober_swag-0.25.1 lib/sober_swag/reporting/input/bool.rb
sober_swag-0.25.0 lib/sober_swag/reporting/input/bool.rb
sober_swag-0.24.1 lib/sober_swag/reporting/input/bool.rb
sober_swag-0.24.0 lib/sober_swag/reporting/input/bool.rb
sober_swag-0.23.0 lib/sober_swag/reporting/input/bool.rb
sober_swag-0.22.0 lib/sober_swag/reporting/input/bool.rb