Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/cupsffi/printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ def self.get_all_printer_attrs(args = {})
release_connection(connection)
hash
end

def self.default_printer
connection = get_connection
walk_attributes(connection) do |dest|
return dest[:name].dup if dest[:is_default] == 1
end
release_connection(connection)
nil
end

def attributes
hash = {}
Expand Down