Class: Puppet::Util::NetworkDevice::Cisco_ios::Model::Line
- Inherits:
-
Base
- Object
- Base
- Puppet::Util::NetworkDevice::Cisco_ios::Model::Line
- Defined in:
- lib/puppet/util/network_device/cisco_ios/model/line.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #after_update ⇒ Object
- #before_update ⇒ Object
-
#initialize(transport, facts, options) ⇒ Line
constructor
A new instance of Line.
- #mod_const_base ⇒ Object
- #mod_path_base ⇒ Object
- #param_class ⇒ Object
- #register_modules ⇒ Object
Constructor Details
#initialize(transport, facts, options) ⇒ Line
Returns a new instance of Line.
10 11 12 13 14 15 16 17 18 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 10 def initialize(transport, facts, ) super(transport, facts) # Initialize some defaults @params ||= {} @name = [:name] if .key? :name # Register all needed Modules based on the available Facts register_modules end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 8 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 8 def params @params end |
Instance Method Details
#after_update ⇒ Object
41 42 43 44 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 41 def after_update transport.command("exit") super end |
#before_update ⇒ Object
36 37 38 39 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 36 def before_update super transport.command("line #{@name}", :prompt => /\(config-line\)#\z/n) end |
#mod_const_base ⇒ Object
24 25 26 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 24 def mod_const_base return Puppet::Util::NetworkDevice::Cisco_ios::Model::Line end |
#mod_path_base ⇒ Object
20 21 22 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 20 def mod_path_base return 'puppet/util/network_device/cisco_ios/model/line' end |
#param_class ⇒ Object
28 29 30 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 28 def param_class return Puppet::Util::NetworkDevice::Cisco_ios::Model::ScopedValue end |
#register_modules ⇒ Object
32 33 34 |
# File 'lib/puppet/util/network_device/cisco_ios/model/line.rb', line 32 def register_modules register_new_module(:base) end |