Class: Glimmer::DSL::Libui::CustomControlSlotContentExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::Libui::CustomControlSlotContentExpression
- Defined in:
- lib/glimmer/dsl/libui/custom_control_slot_content_expression.rb
Instance Method Summary collapse
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
30 31 32 33 34 35 |
# File 'lib/glimmer/dsl/libui/custom_control_slot_content_expression.rb', line 30 def can_interpret?(parent, keyword, *args, &block) slot = keyword.to_s.to_sym block_given? && parent.is_a?(Glimmer::LibUI::CustomControl) && parent.slot_controls.keys.include?(slot) end |
#interpret(parent, keyword, *args, &block) ⇒ Object
37 38 39 40 |
# File 'lib/glimmer/dsl/libui/custom_control_slot_content_expression.rb', line 37 def interpret(parent, keyword, *args, &block) slot = keyword.to_s.to_sym parent.slot_controls[slot]&.content(&block) end |