Class: OpenComponents::RenderedComponent

Inherits:
Component
  • Object
show all
Defined in:
lib/opencomponents/rendered_component.rb

Overview

Wrapper object for components using the ‘rendered` rendering mode.

Instance Attribute Summary collapse

Attributes inherited from Component

#headers, #href, #name, #params, #registry_version, #render_mode, #type, #version

Instance Method Summary collapse

Methods inherited from Component

#flush!, #initialize, #reload!, #request_version

Constructor Details

This class inherits a constructor from OpenComponents::Component

Instance Attribute Details

#htmlObject (readonly)

Public: Returns the HTML String for the rendered component.



5
6
7
# File 'lib/opencomponents/rendered_component.rb', line 5

def html
  @html
end

Instance Method Details

#loadObject

Public: Executes a request for the Component against the configured

registry and sets the component attributes.

Examples

component = OpenComponents::RenderedComponent.new('my-component')
component.load
# => #<OpenComponents::RenderedComponent: ... >

Returns the Component with attributes set.



17
18
19
20
21
# File 'lib/opencomponents/rendered_component.rb', line 17

def load
  @html = response_data['html']

  super
end