Module: Voom::Presenters::DSL::Components::Mixins::Attaches

Includes:
Namespace
Included in:
Card, Card::Media, Content, Dialog, Drawer, ExpansionPanel::Content, Form, Grid, Grid::Column, List, UserInterface
Defined in:
lib/voom/presenters/dsl/components/mixins/attaches.rb

Instance Method Summary collapse

Methods included from Namespace

#_expand_namespace_

Instance Method Details

#attach(presenter, **params, &yield_block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/voom/presenters/dsl/components/mixins/attaches.rb', line 8

def attach(presenter, **params, &yield_block)
  @_yield_block_ = yield_block
  fq_presenter = _expand_namespace_(presenter, namespace)
  presenter = Presenters::App.registered?(fq_presenter) ? fq_presenter : presenter
  pom = Voom::Presenters::App[presenter].call.expand_child(parent: self, context: context.merge(params))
  @components += pom.components if @components
  pom
end