Class: PuppetX::Cups::Ipp::QueryT

Inherits:
Query
  • Object
show all
Defined in:
lib/puppet_x/cups/ipp.rb

Overview

Wrapper class for queries using `ipptool -t`

Instance Method Summary collapse

Methods inherited from Query

#initialize

Constructor Details

This class inherits a constructor from PuppetX::Cups::Ipp::Query

Instance Method Details

#resultsObject


56
57
58
59
60
61
62
# File 'lib/puppet_x/cups/ipp.rb', line 56

def results
  result = /\bDISPLAY\s+(?<attribute>\S+)/i.match(@shellout.stdin)

  raise! if result[:attribute].nil?

  @shellout.stdout.scan(/#{result[:attribute]} \([^)]+\) = (.*)$/).flatten
end