Sha256: eb02bf09c2faa9e6a1597ce1a60d1f7a1eaf4a11d703c135e8e65c8cbe00dfc6
Contents?: true
Size: 476 Bytes
Versions: 13
Compression:
Stored size: 476 Bytes
Contents
module ThreeScaleToolbox module CLI class PrinterTransformer def call(output_format) raise unless %w[yaml json].include?(output_format) case output_format when 'yaml' YamlPrinter.new when 'json' JsonPrinter.new end end end def self.output_flag(dsl) dsl.option :o, :output, 'Output format. One of: json|yaml', argument: :required, transform: PrinterTransformer.new end end end
Version data entries
13 entries across 13 versions & 1 rubygems