Sha256: 6be21df1e04e65d27a45c923d7e843d61b2a96cb54a5237843c1854ee2ac1473

Contents?: true

Size: 270 Bytes

Versions: 1

Compression:

Stored size: 270 Bytes

Contents

module Archer
  module Coder
    def self.dump(value)
      JSON.generate(value)
    end

    def self.load(value)
      JSON.parse(value, {max_nesting: 1}) unless value.nil?
    rescue JSON::ParserError
      # previous format
      value.split("\n")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archer-rails-1.0.0 lib/archer/coder.rb