Sha256: 5a16f145d1c196eba562e5e9f3f75cf5b2f3acb9ce33e4e4fb727b7e7c0f1935

Contents?: true

Size: 578 Bytes

Versions: 4

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true
require 'agave/dump/format/toml'
require 'agave/dump/format/yaml'

module Agave
  module Dump
    module Format
      def self.dump(format, value)
        converter_for(format).dump(value)
      end

      def self.frontmatter_dump(format, value)
        converter_for(format).frontmatter_dump(value)
      end

      def self.converter_for(format)
        case format.to_sym
        when :toml
          Format::Toml
        when :yaml, :yml
          Format::Yaml
        when :json
          Format::Json
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
agave-client-0.1.3 lib/agave/dump/format.rb
agave-client-0.1.2 lib/agave/dump/format.rb
agave-client-0.1.1 lib/agave/dump/format.rb
agave-client-0.1.0 lib/agave/dump/format.rb