Class: TentApiDoc

Inherits:
Object
  • Object
show all
Includes:
TentD::Model
Defined in:
lib/tent-apidoc.rb,
lib/tent-apidoc/examples.rb

Defined Under Namespace

Classes: FaradayAdapter

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.examplesObject

Returns the value of attribute examples.



19
20
21
# File 'lib/tent-apidoc.rb', line 19

def examples
  @examples
end

Class Method Details

.clientsObject



21
22
23
24
25
26
27
28
29
# File 'lib/tent-apidoc.rb', line 21

def clients
  @clients ||= begin
    adapter = [:tent_rack, TentD.new(:database => 'postgres://localhost/tent_doc').tap { DataMapper.auto_migrate! }]
    TentD.faraday_adapter = adapter # tentception
    {
      :base => TentClient.new('https://example.com', :faraday_adapter => adapter)
    }
  end
end

.example(name) ⇒ Object



31
32
33
# File 'lib/tent-apidoc.rb', line 31

def example(name)
  (@examples ||= {})[name] = response_to_markdown(yield)
end

.variablesObject



35
36
37
# File 'lib/tent-apidoc.rb', line 35

def variables
  @variables ||= {}
end