Sha256: 97978082aad8aad444d66e8e278cc8c067c74c285c938fde52d7b8956253e453
Contents?: true
Size: 874 Bytes
Versions: 14
Compression:
Stored size: 874 Bytes
Contents
require_relative 'user_interface' module Voom module Presenters module DSL # The default dsl for ui # This class is held in the container. When a request to render a UI comes in # It creates a new UserInterface instance, binding it to the router and context of the request class Definition def initialize(&block) @block = block end def build self end def expand(router: , context:{}, &block) presenter = UserInterface.new(router: router, context: context, &@block) yield(presenter) if block presenter.expand_instance end def expand_child(parent:, context: {}) presenter = UserInterface.new(parent: parent, context: context, &@block) presenter.expand_instance(freeze: false) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems