class PuppetX::Eos::ModuleBase
ModuleBase
provides a base class for other modules to inherit from. Methods common to all modules should be placed here.
Attributes
api[R]
Public Class Methods
new(api)
click to toggle source
Initialize instance of Module. The Module class provides instance methods to configure module related resources on the target device.
@param [PuppetX::Eos::Eapi] api An instance of Eapi
@return [PuppetX::Eos::ModuleBase]
# File lib/puppet_x/eos/module_base.rb, line 18 def initialize(api) @api = api end
Public Instance Methods
running_configuration()
click to toggle source
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
@api private
@return [String]
# 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