Class: Lutaml::Xsd::Commands::ElementCommand::TreeCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/lutaml/xsd/commands/element_command.rb

Overview

Tree command implementation

Instance Attribute Summary

Attributes inherited from BaseCommand

#options

Instance Method Summary collapse

Constructor Details

#initialize(element_name, package_file, options) ⇒ TreeCommand

Returns a new instance of TreeCommand.



399
400
401
402
403
404
# File 'lib/lutaml/xsd/commands/element_command.rb', line 399

def initialize(element_name, package_file, options)
  super(options)
  @element_name = element_name
  @package_file = package_file
  @max_depth = options[:depth] || 3
end

Instance Method Details

#runObject



406
407
408
409
410
411
# File 'lib/lutaml/xsd/commands/element_command.rb', line 406

def run
  repository = load_repository(@package_file)
  repository = ensure_resolved(repository)

  display_element_tree(repository)
end