class TLAW::API

API is just a top-level {Namespace}.

Basically, you start creating your endpoint by descending from API and defining namespaces and endpoints through a {DSL} like this:

“`ruby class MyCoolAPI < TLAW::API

define do
  base 'http://api.mycool.com'

  namespace :awesome do
    # ...and so on
  end
end

end “`

And then, you use it:

“`ruby api = MyCoolAPI.new api.awesome.cool(param: 'value') “`

See {DSL} for explanation of API definition, {Namespace} for explanation of possible usages and {Endpoint} for real calls performing.

Public Class Methods

define(&block) click to toggle source

Runs the {DSL} inside your API wrapper class.

# File lib/tlaw/api.rb, line 37
def define(&block)
  DSL::APIWrapper.new(self).define(&block)
end
describe(*) click to toggle source

Returns detailed description of an API, like this:

“`ruby MyCoolAPI.describe # MyCoolAPI.new() # This is cool API. # # Namespaces: # .awesome() # This is awesome. “`

Calls superclass method
# File lib/tlaw/api.rb, line 53
def describe(*)
  super.sub(/\A./, '')
end