Class: Rubyang::Database::SchemaTree::Container

Inherits:
InteriorSchemaNode show all
Defined in:
lib/rubyang/database/schema_tree.rb

Instance Attribute Summary collapse

Attributes inherited from InteriorSchemaNode

#arg, #children, #parent, #yang, #yangs

Attributes inherited from SchemaNode

#arg, #module, #parent, #yang, #yangs

Instance Method Summary collapse

Methods inherited from InteriorSchemaNode

#resolve_node, #resolve_uses

Methods inherited from SchemaNode

#evaluate_xpath, #evaluate_xpath_axis, #evaluate_xpath_expr, #evaluate_xpath_node_test, #evaluate_xpath_path, #evaluate_xpath_predicates, #load_yang, #model, #namespace, #prefix, #root, #to_json, #to_s

Constructor Details

#initialize(*args) ⇒ Container

Returns a new instance of Container.



1120
1121
1122
1123
1124
# File 'lib/rubyang/database/schema_tree.rb', line 1120

def initialize *args
  super
  @whens = []
  @musts = []
end

Instance Attribute Details

#mustsObject

Returns the value of attribute musts.



1119
1120
1121
# File 'lib/rubyang/database/schema_tree.rb', line 1119

def musts
  @musts
end

#whensObject

Returns the value of attribute whens.



1119
1120
1121
# File 'lib/rubyang/database/schema_tree.rb', line 1119

def whens
  @whens
end

Instance Method Details

#to_json_recursive(h) ⇒ Object



1125
1126
1127
1128
1129
1130
1131
1132
1133
# File 'lib/rubyang/database/schema_tree.rb', line 1125

def to_json_recursive h
  h['type'] = 'container'
  h['arg'] = @arg
  h['children'] = Hash.new
  @children.each{ |c|
    c.to_json_recursive h['children']
  }
  h
end