Class: RubyMas

Inherits:
Object
  • Object
show all
Defined in:
lib/rubymas.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ RubyMas

Returns a new instance of RubyMas.



4
5
6
# File 'lib/rubymas.rb', line 4

def initialize(hash)
  @connection = hash
end

Instance Method Details

#inventory_reportObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rubymas.rb', line 21

def inventory_report
  connect
  run_report
  telnet.cmd("HP_DUMP3")
  telnet.cmd("p")
  telnet.cmd("fil")
  telnet.cmd("/usr/common")
  telnet.cmd("invdump.csv")
  telnet.cmd("3")
  telnet.cmd("")
  telnet.cmd("Y")
  telnet.cmd("")
  telnet.cmd("")
  telnet.cmd("")
  finish
end

#test_connectObject



8
9
10
11
12
# File 'lib/rubymas.rb', line 8

def test_connect
  telnet.cmd(@connection[:user]) {|c| print c}
  telnet.cmd(@connection[:password]) {|c| print c}
  telnet.close
end

#workorder_reportObject



14
15
16
17
18
19
# File 'lib/rubymas.rb', line 14

def workorder_report
  connect
  run_report
  telnet.cmd("WOH_DUMP")
  finish
end