Class: TRMNLP::ScreenGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/trmnlp/screen_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html, opts = {}) ⇒ ScreenGenerator

Returns a new instance of ScreenGenerator.



9
10
11
12
# File 'lib/trmnlp/screen_generator.rb', line 9

def initialize(html, opts = {})
  self.input = html
  self.image = !!opts[:image]
end

Instance Attribute Details

#imageObject

Returns the value of attribute image.



14
15
16
# File 'lib/trmnlp/screen_generator.rb', line 14

def image
  @image
end

#img_pathObject

Returns the value of attribute img_path.



14
15
16
# File 'lib/trmnlp/screen_generator.rb', line 14

def img_path
  @img_path
end

#inputObject

Returns the value of attribute input.



14
15
16
# File 'lib/trmnlp/screen_generator.rb', line 14

def input
  @input
end

#outputObject

Returns the value of attribute output.



14
15
16
# File 'lib/trmnlp/screen_generator.rb', line 14

def output
  @output
end

#processorObject

Returns the value of attribute processor.



14
15
16
# File 'lib/trmnlp/screen_generator.rb', line 14

def processor
  @processor
end

Instance Method Details

#processObject



16
17
18
19
20
21
# File 'lib/trmnlp/screen_generator.rb', line 16

def process
  convert_to_image
  image ? mono_image(output) : mono(output)
  output.path
  # IO.copy_stream(output, img_path)
end