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

Version Path
voom-presenters-0.1.13 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.12 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.11 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.10 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.9 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.8 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.7 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.6 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.5 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.4 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.3 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.2 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.1 lib/voom/presenters/dsl/definition.rb
voom-presenters-0.1.0 lib/voom/presenters/dsl/definition.rb