Class: Odmget_SRCsubsys
- Inherits:
-
Object
- Object
- Odmget_SRCsubsys
- Defined in:
- lib/AIX/odmget_srcsubsys_entry.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#auditid ⇒ Object
readonly
Returns the value of attribute auditid.
-
#cmdargs ⇒ Object
readonly
Returns the value of attribute cmdargs.
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#data_string_raw ⇒ Object
readonly
Returns the value of attribute data_string_raw.
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#grpname ⇒ Object
readonly
Returns the value of attribute grpname.
-
#multi ⇒ Object
readonly
Returns the value of attribute multi.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#sigforce ⇒ Object
readonly
Returns the value of attribute sigforce.
-
#signorm ⇒ Object
readonly
Returns the value of attribute signorm.
-
#standerr ⇒ Object
readonly
Returns the value of attribute standerr.
-
#standin ⇒ Object
readonly
Returns the value of attribute standin.
-
#standout ⇒ Object
readonly
Returns the value of attribute standout.
-
#subsysname ⇒ Object
readonly
Returns the value of attribute subsysname.
-
#svrkey ⇒ Object
readonly
Returns the value of attribute svrkey.
-
#svrmtype ⇒ Object
readonly
Returns the value of attribute svrmtype.
-
#synonym ⇒ Object
readonly
Returns the value of attribute synonym.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
-
#waittime ⇒ Object
readonly
Returns the value of attribute waittime.
Instance Method Summary collapse
-
#initialize(string) ⇒ Odmget_SRCsubsys
constructor
A new instance of Odmget_SRCsubsys.
- #parse(string) ⇒ Object
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
#action ⇒ Object (readonly)
Returns the value of attribute action.
13 14 15 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 13 def action @action end |
#auditid ⇒ Object (readonly)
Returns the value of attribute auditid.
9 10 11 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 9 def auditid @auditid end |
#cmdargs ⇒ Object (readonly)
Returns the value of attribute cmdargs.
6 7 8 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 6 def cmdargs @cmdargs end |
#contact ⇒ Object (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_raw ⇒ Object (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 |
#display ⇒ Object (readonly)
Returns the value of attribute display.
21 22 23 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 21 def display @display end |
#grpname ⇒ Object (readonly)
Returns the value of attribute grpname.
23 24 25 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 23 def grpname @grpname end |
#multi ⇒ Object (readonly)
Returns the value of attribute multi.
14 15 16 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 14 def multi @multi end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 7 def path @path end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
18 19 20 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 18 def priority @priority end |
#sigforce ⇒ Object (readonly)
Returns the value of attribute sigforce.
20 21 22 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 20 def sigforce @sigforce end |
#signorm ⇒ Object (readonly)
Returns the value of attribute signorm.
19 20 21 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 19 def signorm @signorm end |
#standerr ⇒ Object (readonly)
Returns the value of attribute standerr.
12 13 14 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 12 def standerr @standerr end |
#standin ⇒ Object (readonly)
Returns the value of attribute standin.
10 11 12 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 10 def standin @standin end |
#standout ⇒ Object (readonly)
Returns the value of attribute standout.
11 12 13 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 11 def standout @standout end |
#subsysname ⇒ Object (readonly)
Returns the value of attribute subsysname.
4 5 6 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 4 def subsysname @subsysname end |
#svrkey ⇒ Object (readonly)
Returns the value of attribute svrkey.
16 17 18 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 16 def svrkey @svrkey end |
#svrmtype ⇒ Object (readonly)
Returns the value of attribute svrmtype.
17 18 19 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 17 def svrmtype @svrmtype end |
#synonym ⇒ Object (readonly)
Returns the value of attribute synonym.
5 6 7 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 5 def synonym @synonym end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
8 9 10 |
# File 'lib/AIX/odmget_srcsubsys_entry.rb', line 8 def uid @uid end |
#waittime ⇒ Object (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 |