Class: PuppetX::Eos::ModuleBase

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/eos/module_base.rb

Overview

ModuleBase provides a base class for other modules to inherit from. Methods common to all modules should be placed here.

Direct Known Subclasses

Radius, Tacacs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ PuppetX::Eos::ModuleBase

Initialize instance of Module. The Module class provides instance methods to configure module related resources on the target device.

Parameters:



18
19
20
# File 'lib/puppet_x/eos/module_base.rb', line 18

def initialize(api)
  @api = api
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



9
10
11
# File 'lib/puppet_x/eos/module_base.rb', line 9

def api
  @api
end

Instance Method Details

#running_configurationString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

running_configuration returns the current running configuration as a string. This method is intended to be used by subclasses. The running configuration is returned as a single string object to faciliate the use of String#scan

Returns:

  • (String)


31
32
33
34
# File 'lib/puppet_x/eos/module_base.rb', line 31

def running_configuration
  result = api.enable('show running-config', format: 'text')
  result.last['output']
end