Class: OpenComponents::RenderedComponent
- Defined in:
- lib/opencomponents/rendered_component.rb
Overview
Wrapper object for components using the ‘rendered` rendering mode.
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Public: Returns the HTML String for the rendered component.
Attributes inherited from Component
#headers, #href, #name, #params, #registry_version, #render_mode, #type, #version
Instance Method Summary collapse
-
#load ⇒ Object
Public: Executes a request for the Component against the configured registry and sets the component attributes.
Methods inherited from Component
#flush!, #initialize, #reload!, #request_version
Constructor Details
This class inherits a constructor from OpenComponents::Component
Instance Attribute Details
#html ⇒ Object (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
#load ⇒ Object
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 |