Class: NicInfo::DataNode
- Inherits:
-
Object
- Object
- NicInfo::DataNode
- Defined in:
- lib/nicinfo/data_tree.rb
Instance Attribute Summary collapse
-
#alert ⇒ Object
Returns the value of attribute alert.
-
#children ⇒ Object
Returns the value of attribute children.
-
#data ⇒ Object
Returns the value of attribute data.
-
#data_type ⇒ Object
Returns the value of attribute data_type.
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#rest_ref ⇒ Object
Returns the value of attribute rest_ref.
Instance Method Summary collapse
- #<=>(x) ⇒ Object
- #add_child(node) ⇒ Object
- #empty? ⇒ Boolean
- #has_meta_info ⇒ Object
-
#initialize(name, handle = nil, rest_ref = nil, data = nil, data_type = nil) ⇒ DataNode
constructor
A new instance of DataNode.
- #to_s ⇒ Object
Constructor Details
#initialize(name, handle = nil, rest_ref = nil, data = nil, data_type = nil) ⇒ DataNode
Returns a new instance of DataNode.
25 26 27 28 29 30 31 32 |
# File 'lib/nicinfo/data_tree.rb', line 25 def initialize name, handle = nil, rest_ref = nil, data = nil, data_type = nil @name = name @children = [] @data = data @handle = handle @rest_ref = rest_ref @data_type = data_type end |
Instance Attribute Details
#alert ⇒ Object
Returns the value of attribute alert.
23 24 25 |
# File 'lib/nicinfo/data_tree.rb', line 23 def alert @alert end |
#children ⇒ Object
Returns the value of attribute children.
23 24 25 |
# File 'lib/nicinfo/data_tree.rb', line 23 def children @children end |
#data ⇒ Object
Returns the value of attribute data.
23 24 25 |
# File 'lib/nicinfo/data_tree.rb', line 23 def data @data end |
#data_type ⇒ Object
Returns the value of attribute data_type.
23 24 25 |
# File 'lib/nicinfo/data_tree.rb', line 23 def data_type @data_type end |
#handle ⇒ Object
Returns the value of attribute handle.
23 24 25 |
# File 'lib/nicinfo/data_tree.rb', line 23 def handle @handle end |
#rest_ref ⇒ Object
Returns the value of attribute rest_ref.
23 24 25 |
# File 'lib/nicinfo/data_tree.rb', line 23 def rest_ref @rest_ref end |
Instance Method Details
#<=>(x) ⇒ Object
46 47 48 |
# File 'lib/nicinfo/data_tree.rb', line 46 def <=> x @name <=> x.to_s end |
#add_child(node) ⇒ Object
34 35 36 |
# File 'lib/nicinfo/data_tree.rb', line 34 def add_child node @children << node if node end |
#empty? ⇒ Boolean
42 43 44 |
# File 'lib/nicinfo/data_tree.rb', line 42 def empty? @children.empty? end |
#has_meta_info ⇒ Object
50 51 52 53 54 55 |
# File 'lib/nicinfo/data_tree.rb', line 50 def return true if @handle return true if @rest_ref return true if @data return false end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/nicinfo/data_tree.rb', line 38 def to_s @name end |