Method: Cisco::CommandReference#initialize
- Defined in:
- lib/cisco_node_utils/command_reference.rb
#initialize(product: nil, platform: nil, data_formats: [], files: nil) ⇒ CommandReference
Constructor. Normal usage is to pass product, platform, data_formats, in which case usual YAML files will be located then the list will be filtered down to only those matching the given settings. For testing purposes (only!) you can pass an explicit list of files to load instead. This list will NOT be filtered further by product_id.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/cisco_node_utils/command_reference.rb', line 354 def initialize(product: nil, platform: nil, data_formats: [], files: nil) @product_id = product @platform = platform @data_formats = data_formats @hash = {} if files @files = files else @files = Dir.glob(__dir__ + '/cmd_ref/*.yaml') end build_cmd_ref end |