Class: Smartware::Driver::Printer::Dummy

Inherits:
Object
  • Object
show all
Defined in:
lib/smartware/drivers/printer/dummy.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Dummy

Returns a new instance of Dummy.



7
8
9
# File 'lib/smartware/drivers/printer/dummy.rb', line 7

def initialize(config)

end

Instance Method Details

#errorObject



15
16
17
# File 'lib/smartware/drivers/printer/dummy.rb', line 15

def error
  nil
end

#modelObject



19
20
21
# File 'lib/smartware/drivers/printer/dummy.rb', line 19

def model
  'Generic printer'
end

#new_renderObject



42
43
44
# File 'lib/smartware/drivers/printer/dummy.rb', line 42

def new_render
  DummyRender.new
end


27
28
29
30
31
32
33
34
35
36
# File 'lib/smartware/drivers/printer/dummy.rb', line 27

def print(data)
  name = "smartwareprint_#{Time.now.strftime("%Y-%m-%d-%H:%M:%S")}.txt"
  pathname = File.join(Dir.home, name)

  File.open(pathname, 'w') { |io| io.write data }

  Logging.logger.info "Created #{pathname}"

  true
end

#queryObject



38
39
40
# File 'lib/smartware/drivers/printer/dummy.rb', line 38

def query

end

#statusObject



11
12
13
# File 'lib/smartware/drivers/printer/dummy.rb', line 11

def status
  :ready
end

#versionObject



23
24
25
# File 'lib/smartware/drivers/printer/dummy.rb', line 23

def version
  'from hell'
end