Class: GitHubMarkdownAPI::Raw

Inherits:
APIClient show all
Defined in:
lib/github_markdown_api/raw.rb

Overview

Client implementation of Markdown Raw API

Instance Attribute Summary

Attributes inherited from APIClient

#content_type, #endpoints, #host, #last_response, #port, #scheme

Instance Method Summary collapse

Methods inherited from APIClient

#default_options, #endpoint, #initialize, render, #request, #set_option

Constructor Details

This class inherits a constructor from GitHubMarkdownAPI::APIClient

Instance Method Details

#render(markdown) ⇒ String

Parameters:

  • markdown (String)

Returns:

  • (String)


10
11
12
13
14
15
16
17
18
19
# File 'lib/github_markdown_api/raw.rb', line 10

def render (markdown)
  raw_uri = endpoint(:raw)
  header  = {
    'Content-Type' => @content_type
  }
  post = Net::HTTP::Post.new(raw_uri, header)
  post.body = markdown

  return request(raw_uri, post)
end