Sha256: b5f835b84309a18792b36117556815bf8588559a9322c35e02c2fe453a003b80

Contents?: true

Size: 406 Bytes

Versions: 1

Compression:

Stored size: 406 Bytes

Contents

class Asetus
  def to_json(config)
    Adapter::JSON.to config._asetus_to_hash
  end

  def from_json(json)
    Adapter::JSON.from json
  end

  class Adapter
    class JSON
      class << self
        def to(hash)
          require 'json'
          ::JSON.pretty_generate hash
        end

        def from(json)
          require 'json'
          ::JSON.load json
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asetus-0.4.0 lib/asetus/adapter/json.rb