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.
10 11 12 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 10 def initialize @timeout = 10 end |
Instance Attribute Details
#default_prompt ⇒ Object
Returns the value of attribute default_prompt.
8 9 10 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 8 def default_prompt @default_prompt end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 7 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 7 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 7 def port @port end |
#timeout ⇒ Object
Returns the value of attribute timeout.
8 9 10 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 8 def timeout @timeout end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 7 def user @user end |
Instance Method Details
#command(cmd, options = {}) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 20 def command(cmd, = {}) send(cmd) expect([:prompt] || default_prompt) do |output| yield output if block_given? end end |
#expect(prompt) ⇒ Object
17 18 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 17 def expect(prompt) end |
#send(cmd) ⇒ Object
14 15 |
# File 'lib/puppet/util/network_device/transport/base.rb', line 14 def send(cmd) end |