Class: Teek::UI::TreeInspector::Event
- Inherits:
-
Data
- Object
- Data
- Teek::UI::TreeInspector::Event
- Defined in:
- lib/teek/ui/tree_inspector.rb
Overview
One recorded moment of tree assembly - see #log.
Instance Attribute Summary collapse
-
#action ⇒ Symbol
+:push+/+:pop+ (the build stack, see WidgetDSL#current_path) or
:append(a node added via Node#add_child). -
#node ⇒ Node
The node pushed/popped/appended.
-
#path ⇒ String
For +:push+/+:pop+, the full ancestry breadcrumb this node had while on top of the stack; for
:append, its new parent's own Node#display_name.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Symbol
Returns +:push+/+:pop+ (the build stack, see
WidgetDSL#current_path) or :append (a node added via
Node#add_child).
23 24 25 26 27 28 29 30 31 |
# File 'lib/teek/ui/tree_inspector.rb', line 23 Event = Data.define(:action, :node, :path) do def to_s case action when :push then "-> #{path}" when :pop then "<- #{path}" when :append then "+ #{node.display_name} (under #{path})" end end end |
#node ⇒ Node
Returns the node pushed/popped/appended.
23 24 25 26 27 28 29 30 31 |
# File 'lib/teek/ui/tree_inspector.rb', line 23 Event = Data.define(:action, :node, :path) do def to_s case action when :push then "-> #{path}" when :pop then "<- #{path}" when :append then "+ #{node.display_name} (under #{path})" end end end |
#path ⇒ String
Returns for +:push+/+:pop+, the full ancestry breadcrumb
this node had while on top of the stack; for :append, its new
parent's own Node#display_name.
23 24 25 26 27 28 29 30 31 |
# File 'lib/teek/ui/tree_inspector.rb', line 23 Event = Data.define(:action, :node, :path) do def to_s case action when :push then "-> #{path}" when :pop then "<- #{path}" when :append then "+ #{node.display_name} (under #{path})" end end end |
Instance Method Details
#to_s ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/teek/ui/tree_inspector.rb', line 24 def to_s case action when :push then "-> #{path}" when :pop then "<- #{path}" when :append then "+ #{node.display_name} (under #{path})" end end |