Class: JsonSchemaView::Renderers::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/json_schema_view/renderers/base.rb

Overview

This class is abstract.

Render BaseComponent in a view.

Direct Known Subclasses

Json, ReactOnRails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component) ⇒ Base

Returns a new instance of Base.

Parameters:



12
13
14
# File 'lib/json_schema_view/renderers/base.rb', line 12

def initialize(component)
  @component = component
end

Instance Attribute Details

#componentBaseComponent (readonly)

Returns:



9
10
11
# File 'lib/json_schema_view/renderers/base.rb', line 9

def component
  @component
end

Instance Method Details

#render_in(view_context) ⇒ String

Render the React component by using react_on_rails. This method is used by ActionView::Template::Renderable.

Parameters:

  • view_content (Object)

Returns:

  • (String)

Raises:

  • (NotImplementedError)

See Also:



22
23
24
# File 'lib/json_schema_view/renderers/base.rb', line 22

def render_in(view_context)
  raise NotImplementedError
end