Method: Maglev::BaseComponent#build

Defined in:
app/components/maglev/base_component.rb

#build(component_class, attributes) ⇒ Object



12
13
14
15
16
# File 'app/components/maglev/base_component.rb', line 12

def build(component_class, attributes)
  component_class.new(**attributes).tap do |component|
    component.view_context = view_context
  end
end