Class: Glimmer::DSL::Libui::CustomShapeExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::Libui::CustomShapeExpression
- Includes:
- ParentExpression, TopLevelExpression
- Defined in:
- lib/glimmer/dsl/libui/custom_shape_expression.rb
Instance Method Summary collapse
- #add_content(custom_shape, keyword, *args, &block) ⇒ Object
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#add_content(custom_shape, keyword, *args, &block) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/glimmer/dsl/libui/custom_shape_expression.rb', line 45 def add_content(custom_shape, 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_shape.content&.__getobj__&.source_location custom_shape.content.call(custom_shape) unless custom_shape.content.called? else super end custom_shape.post_add_content if [:post_add_content] end |
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
36 37 38 |
# File 'lib/glimmer/dsl/libui/custom_shape_expression.rb', line 36 def can_interpret?(parent, keyword, *args, &block) LibUI::CustomShape.for(keyword) end |
#interpret(parent, keyword, *args, &block) ⇒ Object
40 41 42 43 |
# File 'lib/glimmer/dsl/libui/custom_shape_expression.rb', line 40 def interpret(parent, keyword, *args, &block) = args.last.is_a?(Hash) ? args.pop : {} LibUI::CustomShape.for(keyword).new(keyword, parent, args, , &block) end |