Class: Odmget_SRCsubsys

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Odmget_SRCsubsys

Returns a new instance of Odmget_SRCsubsys.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 25

def initialize(string)

  @data_string_raw=''

  @subsysname = ''
  @synonym = ''
  @cmdargs = ''
  @path = ''
  @uid = ''
  @auditid = ''
  @standin = ''
  @standout = ''
  @standerr = ''
  @action = 0
  @multi = 0
  @contact = 0
  @svrkey = 0
  @svrmtype = 0
  @priority = 20
  @signorm = 0
  @display = 0
  @waittime = 0
  @grpname = ''


  if string.length > 0
    @data_string_raw = string
    self.parse(string)
  end
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



13
14
15
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 13

def action
  @action
end

#auditidObject (readonly)

Returns the value of attribute auditid.



9
10
11
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 9

def auditid
  @auditid
end

#cmdargsObject (readonly)

Returns the value of attribute cmdargs.



6
7
8
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 6

def cmdargs
  @cmdargs
end

#contactObject (readonly)

Returns the value of attribute contact.



15
16
17
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 15

def contact
  @contact
end

#data_string_rawObject (readonly)

Returns the value of attribute data_string_raw.



3
4
5
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 3

def data_string_raw
  @data_string_raw
end

#displayObject (readonly)

Returns the value of attribute display.



21
22
23
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 21

def display
  @display
end

#grpnameObject (readonly)

Returns the value of attribute grpname.



23
24
25
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 23

def grpname
  @grpname
end

#multiObject (readonly)

Returns the value of attribute multi.



14
15
16
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 14

def multi
  @multi
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 7

def path
  @path
end

#priorityObject (readonly)

Returns the value of attribute priority.



18
19
20
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 18

def priority
  @priority
end

#sigforceObject (readonly)

Returns the value of attribute sigforce.



20
21
22
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 20

def sigforce
  @sigforce
end

#signormObject (readonly)

Returns the value of attribute signorm.



19
20
21
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 19

def signorm
  @signorm
end

#standerrObject (readonly)

Returns the value of attribute standerr.



12
13
14
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 12

def standerr
  @standerr
end

#standinObject (readonly)

Returns the value of attribute standin.



10
11
12
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 10

def standin
  @standin
end

#standoutObject (readonly)

Returns the value of attribute standout.



11
12
13
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 11

def standout
  @standout
end

#subsysnameObject (readonly)

Returns the value of attribute subsysname.



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

def subsysname
  @subsysname
end

#svrkeyObject (readonly)

Returns the value of attribute svrkey.



16
17
18
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 16

def svrkey
  @svrkey
end

#svrmtypeObject (readonly)

Returns the value of attribute svrmtype.



17
18
19
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 17

def svrmtype
  @svrmtype
end

#synonymObject (readonly)

Returns the value of attribute synonym.



5
6
7
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 5

def synonym
  @synonym
end

#uidObject (readonly)

Returns the value of attribute uid.



8
9
10
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 8

def uid
  @uid
end

#waittimeObject (readonly)

Returns the value of attribute waittime.



22
23
24
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 22

def waittime
  @waittime
end

Instance Method Details

#parse(string) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 56

def parse(string)

  regexp = %r{SRCsubsys:\s
\s+subsysname\s*=\s*"(\w+)"\s
\s+synonym\s*=\s*"(\w*)"\s
\s+cmdargs\s*=\s*"([\w\s*\-]*)"\s
\s+path\s*=\s*"([\w\s*\-\/]*)"\s
\s+uid\s*=\s*(\d+)\s
\s+auditid\s*=\s*(\d+)\s
\s+standin\s*=\s*"([\w\s*\-\/]*)"\s
\s+standout\s*=\s*"([\w\s*\-\/]*)"\s
\s+standerr\s*=\s*"([\w\s*\-\/]*)"\s
\s+action\s*=\s*(\d+)\s
\s+multi\s*=\s*(\d+)\s
\s+contact\s*=\s*(\d+)\s
\s+svrkey\s*=\s*(\d+)\s
\s+svrmtype\s*=\s*(\d+)\s
\s+priority\s*=\s*(\d+)\s
\s+signorm\s*=\s*(\d+)\s
\s+sigforce\s*=\s*(\d+)\s
\s+display\s*=\s*(\d+)\s
\s+waittime\s*=\s*(\d+)\s
\s+grpname\s*=\s*"(\w*)"}x




  if match = regexp.match(string)
    @subsysname = match[1]
    @synonym    = match[2]
    @cmdargs    = match[3]
    @path       = match[4]
    @uid        = match[5].to_i
    @auditid    = match[6].to_i
    @standin    = match[7]
    @standout   = match[8]
    @standerr   = match[9]
    @action     = match[10].to_i
    @multi      = match[11].to_i
    @contact    = match[12].to_i
    @svrkey     = match[13].to_i
    @svrmtype   = match[14].to_i
    @priority   = match[15].to_i
    @signorm    = match[16].to_i
    @sigforce   = match[17].to_i
    @display    = match[18].to_i
    @waittime   = match[19].to_i
    @grpname    = match[20]

  else
    puts "can't analyze string, regexp is not working"
    puts string
    raise 'odmget_srcsubsys - regexp is not working'

  end
end