# class Puppet::Util::NetworkDevice::Transport::Telnet

### Public Class Methods

new() click to toggle source
Calls superclass method Puppet::Util::NetworkDevice::Transport::Base.new

    # File lib/puppet/util/network_device/transport/telnet.rb, line 7
    def initialize
      super
    end

### Public Instance Methods

close() click to toggle source

    # File lib/puppet/util/network_device/transport/telnet.rb, line 21
    def close
      @telnet.close if @telnet
      @telnet = nil
    end

command(cmd, options = {}) { |output| ... } click to toggle source

    # File lib/puppet/util/network_device/transport/telnet.rb, line 32
    def command(cmd, options = {})
      send(cmd)
      expect(options[:prompt] || default_prompt) do |output|
        yield output if block_given?
      end
    end

connect() click to toggle source

    # File lib/puppet/util/network_device/transport/telnet.rb, line 15
    def connect
      @telnet = Net::Telnet::new("Host" => host, "Port" => port || 23,
                                 "Timeout" => 10,
                                 "Prompt" => default_prompt)
    end

expect(prompt) { |out| ... } click to toggle source

    # File lib/puppet/util/network_device/transport/telnet.rb, line 26
    def expect(prompt)
      @telnet.waitfor(prompt) do |out|
        yield out if block_given?
      end
    end

handles_login?() click to toggle source

    # File lib/puppet/util/network_device/transport/telnet.rb, line 11
    def handles_login?
      false
    end

send(line) click to toggle source

    # File lib/puppet/util/network_device/transport/telnet.rb, line 39
    def send(line)
      @telnet.puts(line)
    end