Giter Club home page Giter Club logo

api_yard_parser's Introduction

ApiYardParser

This project rocks and uses MIT-LICENSE.

Developed in Locaweb by Thiago Coutinho. www.locaweb.com.br

1. REQUIREMENTS

Ruby/ApiYardParser requires Ruby version 1.9.1 or newer and Rails ~> 3.2.16.

2. INSTALLATION

Add to Gemfile:

gem 'api_yard_parser'

After… in prompt…

bundle install

Try.…

localhost:XXXX/docs

3. Examples

For your controller add the yard doc:

class ApiController < ApplicationController

  # Infos of domain
  # @note 
  #   [ Receive parameters from GET]
  #     https://{APP_URL}/api/:domain
  #
  # @param [String] :domain => Domain name
  # @return [JSON] Response HTTP 412 - Precondition Failed -> Parameters not valid  
  # @return [JSON] Response HTTP 500 - Internal error 
  # @return [JSON] Response HTTP 200 - Show -> Info of domain
  #
  #      {
  #          "domain": "something.com",
  #      }
  def infos
  ...
  end

end

or.…..

class ApiController < ApplicationController

  # Toggle status of alias from domain
  # @type PUT
  # @url https://:APP_URL/domains/:domain/toggle
  #
  # @param [String] domain       -> Name of domain. Parameter in url
  #
  # @return [JSON] Response HTTP 201 - Ok -> Updated
  #
  #    {
  #        "domain": "msf.com",
  #        "status": "enabled"
  #    }
  #
  # @return [JSON] Response HTTP 404 - Not Found -> Domain doesn't exists
  # @return [JSON] Response HTTP 404 - Not Found -> Alias doesn't exists
  # @return [JSON] Response HTTP 500 - Internal server error
  def toggle_status
  ...
  end

end

api_yard_parser's People

Watchers

Thiago Coutinho avatar James Cloos avatar

api_yard_parser's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.