module RBX::Component
Component is a mixin that lazily resolves and compiles a template into a _render_template instance method on the first render, then calls that compiled method directly on every render after that. It also provides the supporting capture/option marshalling behavior compiled templates rely on.
Public Instance Methods
Source
# File rbxrb/lib/rbx/component.rb, line 45 def render klass = self.class klass.send(:compile!, *RBX.resolve_template(klass)) unless klass.respond_to?(:_render_template) _render_template { RBX.safe(@child_buffer.nil? ? "" : @child_buffer) } end
render will lazily compile the template for this class and then render it using the class as context as the compilation will define a _render_template method on the instance.