Module: Cisco::Common

Included in:
SSH, Telnet
Defined in:
lib/cisco/common.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host.



5
6
7
# File 'lib/cisco/common.rb', line 5

def host
  @host
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/cisco/common.rb', line 5

def password
  @password
end

#promptObject

Returns the value of attribute prompt.



5
6
7
# File 'lib/cisco/common.rb', line 5

def prompt
  @prompt
end

Instance Method Details

#clear_cmdObject



23
24
25
# File 'lib/cisco/common.rb', line 23

def clear_cmd
  @cmdbuf = []
end

#clear_initObject



19
20
21
# File 'lib/cisco/common.rb', line 19

def clear_init
  @extra_init = []
end

#enable(password, pwprompt = nil) ⇒ Object



7
8
9
10
11
12
# File 'lib/cisco/common.rb', line 7

def enable(password, pwprompt = nil)
  @pwprompt = pwprompt || @pwprompt
  old = @prompt
  cmd("enable", @pwprompt)
  cmd(password, old)
end

#extra_init(*args) ⇒ Object



14
15
16
17
# File 'lib/cisco/common.rb', line 14

def extra_init(*args)
  cmd(*args)
  @extra_init << @cmdbuf.pop
end