Class: SourceTreeNode
- Inherits:
-
Object
- Object
- SourceTreeNode
- Defined in:
- ext/ae-editor/ae-editor.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#helptext ⇒ Object
Returns the value of attribute helptext.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#label ⇒ Object
Returns the value of attribute label.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#rif ⇒ Object
Returns the value of attribute rif.
-
#rif_end ⇒ Object
Returns the value of attribute rif_end.
-
#sons ⇒ Object
readonly
Returns the value of attribute sons.
-
#sortable ⇒ Object
Returns the value of attribute sortable.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(parent = nil, kind = 'class', sortable = true) {|_self| ... } ⇒ SourceTreeNode
constructor
A new instance of SourceTreeNode.
Constructor Details
#initialize(parent = nil, kind = 'class', sortable = true) {|_self| ... } ⇒ SourceTreeNode
Returns a new instance of SourceTreeNode.
19 20 21 22 23 24 25 26 27 28 |
# File 'ext/ae-editor/ae-editor.rb', line 19 def initialize(parent=nil, kind='class', sortable=true) @sons = Array.new @parent = parent @kind = kind @sortable = sortable if @parent !=nil @parent.sons << self end yield(self) if block_given? end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
18 19 20 |
# File 'ext/ae-editor/ae-editor.rb', line 18 def args @args end |
#helptext ⇒ Object
Returns the value of attribute helptext.
18 19 20 |
# File 'ext/ae-editor/ae-editor.rb', line 18 def helptext @helptext end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
17 18 19 |
# File 'ext/ae-editor/ae-editor.rb', line 17 def kind @kind end |
#label ⇒ Object
Returns the value of attribute label.
18 19 20 |
# File 'ext/ae-editor/ae-editor.rb', line 18 def label @label end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
16 17 18 |
# File 'ext/ae-editor/ae-editor.rb', line 16 def parent @parent end |
#rif ⇒ Object
Returns the value of attribute rif.
18 19 20 |
# File 'ext/ae-editor/ae-editor.rb', line 18 def rif @rif end |
#rif_end ⇒ Object
Returns the value of attribute rif_end.
18 19 20 |
# File 'ext/ae-editor/ae-editor.rb', line 18 def rif_end @rif_end end |
#sons ⇒ Object (readonly)
Returns the value of attribute sons.
15 16 17 |
# File 'ext/ae-editor/ae-editor.rb', line 15 def sons @sons end |
#sortable ⇒ Object
Returns the value of attribute sortable.
18 19 20 |
# File 'ext/ae-editor/ae-editor.rb', line 18 def sortable @sortable end |
Instance Method Details
#<=>(other) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'ext/ae-editor/ae-editor.rb', line 30 def <=> (other) if self.sortable && other.sortable self.label.strip <=> other.label.strip elsif !self.sortable -1 elsif !other.sortable 1 end end |