Class: Commutateurs::Fortigate

Inherits:
Base
  • Object
show all
Defined in:
lib/commutateurs/fortigate.rb

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(host, credentials, verbose = false) ⇒ Fortigate

Returns a new instance of Fortigate.



3
4
5
6
7
# File 'lib/commutateurs/fortigate.rb', line 3

def initialize(host, credentials, verbose = false)
  super
  @transport.default_prompt = / [#\$] $/
  @transport.more = /--More-- /
end

Instance Method Details

#configurationObject



16
17
18
# File 'lib/commutateurs/fortigate.rb', line 16

def configuration
  execute('show')
end

#connectObject



12
13
14
# File 'lib/commutateurs/fortigate.rb', line 12

def connect
  @transport.connect
end

#disconnectObject



23
24
25
26
# File 'lib/commutateurs/fortigate.rb', line 23

def disconnect
  @transport.send 'exit'
  @transport.close
end

#enableObject



9
10
# File 'lib/commutateurs/fortigate.rb', line 9

def enable
end

#saveObject



20
21
# File 'lib/commutateurs/fortigate.rb', line 20

def save
end