Class: LVM::Wrapper::PVSSEG
- Inherits:
-
Object
- Object
- LVM::Wrapper::PVSSEG
- Includes:
- Reporting
- Defined in:
- lib/lvm/wrapper/pvsseg.rb
Overview
segment output is very different in that its multi line, easier to treat as own command
Constant Summary collapse
- BASE_COMMAND =
"pvs #{Reporting::BASE_ARGUMENTS}"- ATTRIBUTES_FILE =
'pvsseg.yaml'
Constants included from Reporting::Constants
Reporting::Constants::BASE_ARGUMENTS, Reporting::Constants::EMPTY, Reporting::Constants::SEPERATOR
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(options) ⇒ PVSSEG
constructor
A new instance of PVSSEG.
- #list ⇒ Object
Methods included from Reporting
Constructor Details
#initialize(options) ⇒ PVSSEG
Returns a new instance of PVSSEG.
13 14 15 16 |
# File 'lib/lvm/wrapper/pvsseg.rb', line 13 def initialize() @attributes = Attributes.load([:version], ATTRIBUTES_FILE) @command = "#{options[:command]} #{Reporting.build_command(attributes, BASE_COMMAND)}" end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
10 11 12 |
# File 'lib/lvm/wrapper/pvsseg.rb', line 10 def attributes @attributes end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
11 12 13 |
# File 'lib/lvm/wrapper/pvsseg.rb', line 11 def command @command end |
Instance Method Details
#list ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/lvm/wrapper/pvsseg.rb', line 21 def list output = External.cmd(@command) data = parse(output) if block_given? return data.each { |obj| yield obj } else return data end end |