Class: Oode::Printer

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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, options = {})
  @printer_name = name
  @session = session
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/oode/print/printer.rb', line 15

def options
  @options
end

#printer_nameObject (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

#sessionObject (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