Class: ASTTreeItem
- Inherits:
-
Object
- Object
- ASTTreeItem
- Includes:
- JRubyFX
- Defined in:
- lib/jruby_visualizer/ast_tree_view_builder.rb
Overview
Custom TreeItem, to store the JRuby’s AST Node within the item
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(node) ⇒ ASTTreeItem
constructor
A new instance of ASTTreeItem.
- #node_string ⇒ Object
Constructor Details
#initialize(node) ⇒ ASTTreeItem
Returns a new instance of ASTTreeItem.
29 30 31 32 33 |
# File 'lib/jruby_visualizer/ast_tree_view_builder.rb', line 29 def initialize(node) @node = node super(node_string) (true) end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
27 28 29 |
# File 'lib/jruby_visualizer/ast_tree_view_builder.rb', line 27 def node @node end |
Instance Method Details
#node_string ⇒ Object
35 36 37 38 |
# File 'lib/jruby_visualizer/ast_tree_view_builder.rb', line 35 def node_string node_information = @node.respond_to?(:name) ? ":#{@node.name}" : '' "#{@node.node_name}#{node_information} #{@node.position.start_line}" end |