Class: Docit::UI::BaseRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/docit/ui/base_renderer.rb

Direct Known Subclasses

ScalarRenderer, SwaggerRenderer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec_url:, nav_paths: {}) ⇒ BaseRenderer

Returns a new instance of BaseRenderer.



8
9
10
11
12
# File 'lib/docit/ui/base_renderer.rb', line 8

def initialize(spec_url:, nav_paths: {})
  @spec_url = spec_url
  @nav_paths = nav_paths
  @title = ERB::Util.html_escape(Docit.configuration.title)
end

Instance Attribute Details

Returns the value of attribute nav_paths.



6
7
8
# File 'lib/docit/ui/base_renderer.rb', line 6

def nav_paths
  @nav_paths
end

#spec_urlObject (readonly)

Returns the value of attribute spec_url.



6
7
8
# File 'lib/docit/ui/base_renderer.rb', line 6

def spec_url
  @spec_url
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/docit/ui/base_renderer.rb', line 6

def title
  @title
end

Instance Method Details

#renderObject

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/docit/ui/base_renderer.rb', line 14

def render
  raise NotImplementedError, "#{self.class}#render must be implemented"
end