Class: Oode::Printer
- Inherits:
-
Object
- Object
- Oode::Printer
- Defined in:
- lib/oode/print/printer.rb
Constant Summary collapse
- OO_FILETYPES =
['doc', 'docx', 'odf', 'rtf']
- SIZE_LIMIT =
5MB
5242880
- JOB_LIMIT =
5
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#printer_name ⇒ Object
readonly
Returns the value of attribute printer_name.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(name, session, options = {}) ⇒ Printer
constructor
A new instance of Printer.
- #print!(file) ⇒ Object
Constructor Details
#initialize(name, session, options = {}) ⇒ Printer
Returns a new instance of Printer.
17 18 19 20 21 |
# File 'lib/oode/print/printer.rb', line 17 def initialize(name, session, = {}) @printer_name = name @session = session @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/oode/print/printer.rb', line 15 def @options end |
#printer_name ⇒ Object (readonly)
Returns the value of attribute printer_name.
13 14 15 |
# File 'lib/oode/print/printer.rb', line 13 def printer_name @printer_name end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
14 15 16 |
# File 'lib/oode/print/printer.rb', line 14 def session @session end |
Instance Method Details
#print!(file) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/oode/print/printer.rb', line 23 def print! file check_size file #check_working command = print_command(file) notify "Printing file: #{file.basename.greenish} to #{printer_name.red}" session.exec!(command) end |