module RBX::Component::ClassMethods
ClassMethods is extended onto any class that includes Component. It handles template resolution and compilation.
Public Instance Methods
Source
# File rbxrb/lib/rbx/component.rb, line 24 def template_file(filepath) loc, tmpl = RBX.extract_template(filepath, self, inline: false) compile!(loc, tmpl) end
Set the template for this class as the contents of a separate file
Source
# File rbxrb/lib/rbx/component.rb, line 19 def template_source(tmpl) compile!(caller_locations(1, 1).first.absolute_path, tmpl) end
Set the template for this class as a provided string. This method uses caller location to be able to provide better error messages.