Class: PuppetX::Cups::Server::IppResult

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

Overview

The IppResult class encapsules the use of the ‘ipptool` comand line utility. It provides helper methods and basic error handling.

Instance Method Summary collapse

Constructor Details

#initialize(request, resource = '/') ⇒ IppResult

Returns a new instance of IppResult.



10
11
12
13
# File 'lib/puppet_x/cups/server.rb', line 10

def initialize(request, resource = '/')
  @output, @error, process = query(resource, request)
  raise('Unexpected response from CUPS server.') if process.exitstatus != 0
end

Instance Method Details

#linesObject



15
16
17
# File 'lib/puppet_x/cups/server.rb', line 15

def lines
  @output.split("\n")[1..-1]
end