Class: SoberSwag::Reporting::Output::Text

Inherits:
Base
  • Object
show all
Defined in:
lib/sober_swag/reporting/output/text.rb

Overview

Output raw text.

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/text.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/text.rb', line 11

def serialize_report(input)
  result = call(input)

  return Report::Value.new(['was not a string']) unless result.is_a?(String)

  result
end

#swagger_schemaObject



19
20
21
# File 'lib/sober_swag/reporting/output/text.rb', line 19

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