Class: Glimmer::DSL::Libui::ControlExpression

Inherits:
Expression
  • Object
show all
Includes:
ParentExpression
Defined in:
lib/glimmer/dsl/libui/control_expression.rb

Instance Method Summary collapse

Instance Method Details

#add_content(parent, keyword, *args, &block) ⇒ Object



40
41
42
43
44
45
# File 'lib/glimmer/dsl/libui/control_expression.rb', line 40

def add_content(parent, keyword, *args, &block)
  options = args.last.is_a?(Hash) ? args.last : {}
  options[:post_add_content] = true if !options.include?(:post_add_content)
  super
  parent&.post_add_content if options[:post_add_content]
end

#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/glimmer/dsl/libui/control_expression.rb', line 31

def can_interpret?(parent, keyword, *args, &block)
  Glimmer::LibUI::ControlProxy.exists?(keyword)
end

#interpret(parent, keyword, *args, &block) ⇒ Object



35
36
37
38
# File 'lib/glimmer/dsl/libui/control_expression.rb', line 35

def interpret(parent, keyword, *args, &block)
  keyword = Glimmer::LibUI::ControlProxy::KEYWORD_ALIASES[keyword] || keyword
  Glimmer::LibUI::ControlProxy.create(keyword, parent, args, &block)
end