Class: Glimmer::DSL::Libui::ShapeExpression
- Inherits:
-
Expression
- Object
- Expression
- Glimmer::DSL::Libui::ShapeExpression
- Includes:
- ParentExpression
- Defined in:
- lib/glimmer/dsl/libui/shape_expression.rb
Instance Method Summary collapse
- #add_content(parent, keyword, *args, &block) ⇒ Object
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#add_content(parent, keyword, *args, &block) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/glimmer/dsl/libui/shape_expression.rb', line 50 def add_content(parent, keyword, *args, &block) = args.last.is_a?(Hash) ? args.last : {} [:post_add_content] = true if !.include?(:post_add_content) super parent&.post_add_content if [:post_add_content] end |
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
34 35 36 37 38 39 40 41 42 |
# File 'lib/glimmer/dsl/libui/shape_expression.rb', line 34 def can_interpret?(parent, keyword, *args, &block) Glimmer::LibUI::Shape.exists?(keyword) and ( parent.is_a?(Glimmer::LibUI::ControlProxy::PathProxy) or parent.is_a?(Glimmer::LibUI::Shape) or parent.is_a?(Glimmer::LibUI::ControlProxy::AreaProxy) or (parent.nil? && Glimmer::LibUI::ControlProxy::AreaProxy.current_area_draw_params) ) end |
#interpret(parent, keyword, *args, &block) ⇒ Object
44 45 46 47 48 |
# File 'lib/glimmer/dsl/libui/shape_expression.rb', line 44 def interpret(parent, keyword, *args, &block) keyword = Glimmer::LibUI::Shape::KEYWORD_ALIASES[keyword] || keyword args = [args] if args.size > 1 && Glimmer::LibUI::Shape.shape_class(keyword).parameters.size == 1 Glimmer::LibUI::Shape.create(keyword, parent, args, &block) end |