Class: HTTP::MimeType::JSON

### Home Classes Methods

### In Files

- lib/http/mime_type/json.rb

### Parent

HTTP::MimeType::Adapter

### Methods

- #decode
- #encode

### Class/Module Index

Quicksearch

- HTTP
- HTTP::Chainable
- HTTP::Client
- HTTP::Error
- HTTP::Headers
- HTTP::Headers::Mixin
- HTTP::MimeType
- HTTP::MimeType::Adapter
- HTTP::MimeType::JSON
- HTTP::Options
- HTTP::Redirector
- HTTP::Redirector::EndlessRedirectError
- HTTP::Redirector::TooManyRedirectsError
- HTTP::Request
- HTTP::Request::UnsupportedMethodError
- HTTP::Request::UnsupportedSchemeError
- HTTP::Request::Writer
- HTTP::RequestError
- HTTP::Response
- HTTP::Response::Body
- HTTP::Response::Parser
- HTTP::Response::Status
- HTTP::ResponseError
- HTTP::StateError
- Object

No matching classes.

# HTTP::MimeType::JSON

JSON encode/decode MIME type adapter

### Public Instance Methods

decode(str) click to toggle source

Decodes JSON

    # File lib/http/mime_type/json.rb, line 15
    def decode(str)
      ::JSON.load str
    end

encode(obj) click to toggle source

Encodes object to JSON

    # File lib/http/mime_type/json.rb, line 9
    def encode(obj)
      return obj.to_json if obj.respond_to?(:to_json)
      ::JSON.dump obj
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.