module Opushon

Namespace for the Opushon library. Representation of documentations for HTTP APIs.

@api private

Public Class Methods

dump(opushon) click to toggle source

Dump Ruby object to a Opushon string.

@api public

@param [Body] opushon

@return [String] the Opushon data representation

# File lib/opushon.rb, line 32
def self.dump(opushon)
  opushon.to_h.to_json
end
load(opushon_string) click to toggle source

Load opushon in to the Ruby data structure.

@api public

@example Load the option of a DELETE interface

load('{"DELETE":{"title":"Delete issues","description":"Remove every issues.","request":{"headers":{},"query_string":{},"body":{}},"response":{"headers":{},"query_string":{},"body":{}}}}')

@param [String] opushon_string

@return [Body] the Ruby data structure

# File lib/opushon.rb, line 20
def self.load(opushon_string)
  opushon_hash = JSON.parse(opushon_string)
  Body.load(opushon_hash)
end