Class: Lsps_entry
- Inherits:
-
Object
- Object
- Lsps_entry
- Defined in:
- lib/AIX/lsps_entry.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#auto ⇒ Object
readonly
Returns the value of attribute auto.
-
#psname ⇒ Object
readonly
Returns the value of attribute psname.
-
#pvname ⇒ Object
readonly
Returns the value of attribute pvname.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#used ⇒ Object
readonly
Returns the value of attribute used.
-
#vgname ⇒ Object
readonly
Returns the value of attribute vgname.
Instance Method Summary collapse
-
#initialize(string = '') ⇒ Lsps_entry
constructor
A new instance of Lsps_entry.
- #parse(string = '') ⇒ Object
Constructor Details
#initialize(string = '') ⇒ Lsps_entry
Returns a new instance of Lsps_entry.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/AIX/lsps_entry.rb', line 12 def initialize(string = '') @psname = nil @pvname = nil @vgname = nil @size = nil @used = nil @active = nil @auto = nil @type = nil parse(string) unless string.empty? end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
8 9 10 |
# File 'lib/AIX/lsps_entry.rb', line 8 def active @active end |
#auto ⇒ Object (readonly)
Returns the value of attribute auto.
9 10 11 |
# File 'lib/AIX/lsps_entry.rb', line 9 def auto @auto end |
#psname ⇒ Object (readonly)
Returns the value of attribute psname.
3 4 5 |
# File 'lib/AIX/lsps_entry.rb', line 3 def psname @psname end |
#pvname ⇒ Object (readonly)
Returns the value of attribute pvname.
4 5 6 |
# File 'lib/AIX/lsps_entry.rb', line 4 def pvname @pvname end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
6 7 8 |
# File 'lib/AIX/lsps_entry.rb', line 6 def size @size end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/AIX/lsps_entry.rb', line 10 def type @type end |
#used ⇒ Object (readonly)
Returns the value of attribute used.
7 8 9 |
# File 'lib/AIX/lsps_entry.rb', line 7 def used @used end |
#vgname ⇒ Object (readonly)
Returns the value of attribute vgname.
5 6 7 |
# File 'lib/AIX/lsps_entry.rb', line 5 def vgname @vgname end |
Instance Method Details
#parse(string = '') ⇒ Object
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 |
# File 'lib/AIX/lsps_entry.rb', line 25 def parse(string = '') regexp = %r{^ ([\w\_\-]+)\s+#Paging Space Name ([\w\_\-]+)\s+#PV name ([\w\_\-]+)\s+#VG name (\d+MB)\s+ # size (\d+)\s+ # used (yes|no)\s+ #active (yes|no)\s+ #auto (lv)\s* #Type $}x if match = regexp.match(string) @psname = match[1] @pvname = match[2] @vgname = match[3] @size = match[4] @used = match[5].to_i @active = match[6] @auto = match[7] @type = match[8] else raise Exception, "Can't parse string >#{string}<" end true end |