class Restspec::Docs::TemplateContext

Public Instance Methods

endpoints_store() click to toggle source
# File lib/restspec/runners/docs/template_context.rb, line 8
def endpoints_store
  Restspec::EndpointStore
end
json_example(schema) click to toggle source
# File lib/restspec/runners/docs/template_context.rb, line 16
def json_example(schema)
  sample = Restspec::Schema::SchemaExample.new(schema).value
  JSON.pretty_generate(sample).gsub(/^/, '  ')
end
json_example_code(schema) click to toggle source
# File lib/restspec/runners/docs/template_context.rb, line 21
def json_example_code(schema)
  "<div class=\"highlight highlight-json\">
    <pre><code>#{json_example(schema)}</pre></code>
  </div>"
end
namespace_store() click to toggle source
# File lib/restspec/runners/docs/template_context.rb, line 4
def namespace_store
  Restspec::NamespaceStore
end
schema_store() click to toggle source
# File lib/restspec/runners/docs/template_context.rb, line 12
def schema_store
  Restspec::SchemaStore
end