Class: TRMNLP::ScreenGenerator
- Inherits:
-
Object
- Object
- TRMNLP::ScreenGenerator
- Defined in:
- lib/trmnlp/screen_generator.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
Returns the value of attribute image.
-
#img_path ⇒ Object
Returns the value of attribute img_path.
-
#input ⇒ Object
Returns the value of attribute input.
-
#output ⇒ Object
Returns the value of attribute output.
-
#processor ⇒ Object
Returns the value of attribute processor.
Instance Method Summary collapse
-
#initialize(html, opts = {}) ⇒ ScreenGenerator
constructor
A new instance of ScreenGenerator.
- #process ⇒ Object
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
#image ⇒ Object
Returns the value of attribute image.
14 15 16 |
# File 'lib/trmnlp/screen_generator.rb', line 14 def image @image end |
#img_path ⇒ Object
Returns the value of attribute img_path.
14 15 16 |
# File 'lib/trmnlp/screen_generator.rb', line 14 def img_path @img_path end |
#input ⇒ Object
Returns the value of attribute input.
14 15 16 |
# File 'lib/trmnlp/screen_generator.rb', line 14 def input @input end |
#output ⇒ Object
Returns the value of attribute output.
14 15 16 |
# File 'lib/trmnlp/screen_generator.rb', line 14 def output @output end |
#processor ⇒ Object
Returns the value of attribute processor.
14 15 16 |
# File 'lib/trmnlp/screen_generator.rb', line 14 def processor @processor end |
Instance Method Details
#process ⇒ Object
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 |