Class: Glimmer::DSL::Libui::CustomControlExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::Libui::CustomControlExpression
- Includes:
- ParentExpression, TopLevelExpression
- Defined in:
- lib/glimmer/dsl/libui/custom_control_expression.rb
Instance Method Summary collapse
- #add_content(custom_control, keyword, *args, &block) ⇒ Object
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#add_content(custom_control, keyword, *args, &block) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/glimmer/dsl/libui/custom_control_expression.rb', line 46 def add_content(custom_control, keyword, *args, &block) = args.last.is_a?(Hash) ? args.last : {} [:post_add_content] = true if !.include?(:post_add_content) # TODO consider avoiding source_location if block.source_location == custom_control.content&.__getobj__&.source_location custom_control.content.call(custom_control) unless custom_control.content.called? else super end custom_control.post_add_content if [:post_add_content] end |
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
37 38 39 |
# File 'lib/glimmer/dsl/libui/custom_control_expression.rb', line 37 def can_interpret?(parent, keyword, *args, &block) LibUI::CustomControl.for(keyword) end |
#interpret(parent, keyword, *args, &block) ⇒ Object
41 42 43 44 |
# File 'lib/glimmer/dsl/libui/custom_control_expression.rb', line 41 def interpret(parent, keyword, *args, &block) = args.last.is_a?(Hash) ? args.pop : {} LibUI::CustomControl.for(keyword).new(keyword, parent, args, , &block) end |