Class: Rubyang::Database::SchemaTree

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

Defined Under Namespace

Classes: Anyxml, BinaryType, Bit, BitsType, BooleanType, Case, Choice, Container, Decimal64Type, EmptyType, Enum, EnumerationType, Identityref, Input, IntegerType, InteriorSchemaNode, Leaf, LeafList, LeafSchemaNode, LeafrefType, Length, List, MaxElements, MinElements, Must, Notification, Output, Path, Pattern, Range, Root, Rpc, SchemaNode, StringType, Type, UnionType, When

Instance Method Summary collapse

Constructor Details

#initialize(yangs) ⇒ SchemaTree

Returns a new instance of SchemaTree.



1198
1199
1200
1201
# File 'lib/rubyang/database/schema_tree.rb', line 1198

def initialize yangs
  @yangs = yangs
  @root  = Root.new @yangs
end

Instance Method Details

#load(model) ⇒ Object



1213
1214
1215
# File 'lib/rubyang/database/schema_tree.rb', line 1213

def load model
  @root.load_yang( model )
end

#rootObject



1210
1211
1212
# File 'lib/rubyang/database/schema_tree.rb', line 1210

def root
  @root
end

#to_s(parent = true) ⇒ Object



1202
1203
1204
1205
1206
1207
1208
1209
# File 'lib/rubyang/database/schema_tree.rb', line 1202

def to_s parent=true
  head, vars, tail = "#<#{self.class.to_s}:0x#{(self.object_id << 1).to_s(16).rjust(14,'0')} ", Array.new, ">"
  if parent
    vars.push "@yangs=#{@yangs.to_s}"
    vars.push "@root=#{@root.to_s( false )}"
  end
  head + vars.join(', ') + tail
end