Class: Puppet::Util::NetworkDevice::Transport::Base
- Defined in:
- lib/puppet/util/network_device/transport/base.rb
Instance Attribute Summary collapse
-
#default_prompt ⇒ Object
Returns the value of attribute default_prompt.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #command(cmd, options = {}) ⇒ Object
- #expect(prompt) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #send(cmd) ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 9 def initialize @timeout = 10 end |
Instance Attribute Details
#default_prompt ⇒ Object
Returns the value of attribute default_prompt.
7 8 9 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 7 def default_prompt @default_prompt end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 6 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 6 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 6 def port @port end |
#timeout ⇒ Object
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 7 def timeout @timeout end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 6 def user @user end |
Instance Method Details
#command(cmd, options = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 19 def command(cmd, = {}) send(cmd) expect([:prompt] || default_prompt) do |output| yield output if block_given? end end |
#expect(prompt) ⇒ Object
16 17 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 16 def expect(prompt) end |
#send(cmd) ⇒ Object
13 14 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 13 def send(cmd) end |