Class: SoberSwag::Reporting::Output::Bool
- Inherits:
-
Base
- Object
- Base
- SoberSwag::Reporting::Output::Bool
show all
- Defined in:
- lib/sober_swag/reporting/output/bool.rb
Overview
Instance Method Summary
collapse
Methods inherited from Base
#view, #views
Methods included from Interface
#call!, #described, #enum, #in_range, #list, #nilable, #partitioned, #referenced, #reporting?, #serialize, #via_map
Instance Method Details
#call(input) ⇒ Object
7
8
9
|
# File 'lib/sober_swag/reporting/output/bool.rb', line 7
def call(input)
input
end
|
#serialize_report(input) ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/sober_swag/reporting/output/bool.rb', line 11
def serialize_report(input)
result = call(input)
return Report::Value.new(['was not a boolean']) unless [true, false].include?(result)
result
end
|
#swagger_schema ⇒ Object
19
20
21
|
# File 'lib/sober_swag/reporting/output/bool.rb', line 19
def swagger_schema
[{ type: 'boolean' }, {}]
end
|