Sha256: 251a42af9f3b3ad3bce0099bcac91b0a6bfa3fd1738eb1970af3fef557e3a171
Contents?: true
Size: 1.06 KB
Versions: 6
Compression:
Stored size: 1.06 KB
Contents
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 attr_reader :name, :namespace, :options def initialize(name, namespace, options, &block) @block = block @name = name @namespace = namespace @options = options end def build self end def expand(router: , context:{}, &block) presenter = UserInterface.new(router: router, context: context, name: @name, namespace: @namespace, &@block) yield(presenter) if block presenter.expand_instance end # Used by attach def expand_child(parent:, context: {}) presenter = UserInterface.new(parent: parent, context: context, namespace: @namespace, &@block) presenter.expand_instance(freeze: false) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems