Sha256: d0100831b4ad4c0385bcf512858dcaa191d68de6cdd386607b13dba859577423

Contents?: true

Size: 463 Bytes

Versions: 7

Compression:

Stored size: 463 Bytes

Contents

module SoberSwag
  module Reporting
    module Output
      ##
      # Output booleans.
      class Bool < Base
        def call(input)
          input
        end

        def serialize_report(input)
          result = call(input)

          return Report::Value.new(['was not a boolean']) unless [true, false].include?(result)

          result
        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/output/bool.rb
sober_swag-0.25.1 lib/sober_swag/reporting/output/bool.rb
sober_swag-0.25.0 lib/sober_swag/reporting/output/bool.rb
sober_swag-0.24.1 lib/sober_swag/reporting/output/bool.rb
sober_swag-0.24.0 lib/sober_swag/reporting/output/bool.rb
sober_swag-0.23.0 lib/sober_swag/reporting/output/bool.rb
sober_swag-0.22.0 lib/sober_swag/reporting/output/bool.rb