Class: GrapeSlate::Document

Inherits:
GrapeMarkdown::Document
  • Object
show all
Defined in:
lib/grape-slate/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_class) ⇒ Document



5
6
7
8
9
# File 'lib/grape-slate/document.rb', line 5

def initialize(api_class)
  super

  @shell_template = template_for(:shell)
end

Instance Attribute Details

#shell_templateObject (readonly)

Returns the value of attribute shell_template.



3
4
5
# File 'lib/grape-slate/document.rb', line 3

def shell_template
  @shell_template
end

Instance Method Details

#shell_example(route, resource) ⇒ Object



11
12
13
14
15
# File 'lib/grape-slate/document.rb', line 11

def shell_example(route, resource)
  example = ExampleGenerator::Shell.new(route, resource)

  render(shell_template, example.example_binding)
end