Class: TRMNLP::ScreenGenerator

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

Defined Under Namespace

Classes: BrowserPool

Constant Summary collapse

@@browser_pool =

Class-level browser pool shared across all instances

BrowserPool.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ScreenGenerator.



103
104
105
106
# File 'lib/trmnlp/screen_generator.rb', line 103

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

Instance Attribute Details

#imageObject

Returns the value of attribute image.



108
109
110
# File 'lib/trmnlp/screen_generator.rb', line 108

def image
  @image
end

#img_pathObject

Returns the value of attribute img_path.



108
109
110
# File 'lib/trmnlp/screen_generator.rb', line 108

def img_path
  @img_path
end

#inputObject

Returns the value of attribute input.



108
109
110
# File 'lib/trmnlp/screen_generator.rb', line 108

def input
  @input
end

#outputObject

Returns the value of attribute output.



108
109
110
# File 'lib/trmnlp/screen_generator.rb', line 108

def output
  @output
end

#processorObject

Returns the value of attribute processor.



108
109
110
# File 'lib/trmnlp/screen_generator.rb', line 108

def processor
  @processor
end

Instance Method Details

#processObject



110
111
112
113
114
# File 'lib/trmnlp/screen_generator.rb', line 110

def process
  convert_to_image
  image ? mono_image(output) : mono(output)
  output
end