class RopenPi::Specs::Writer

concrete

Public Class Methods

new(open_api_output_format) click to toggle source
# File lib/ropen_pi/specs/writer.rb, line 17
def initialize(open_api_output_format)
  @output_format = open_api_output_format
end

Public Instance Methods

write(doc) click to toggle source
# File lib/ropen_pi/specs/writer.rb, line 21
def write(doc)
  if @output_format == :yaml || @output_format == :yml
    Yml.convert(doc)
  else
    # this is by any means the default
    Json.convert(doc)
  end
end