Class: Sqed::Parser
- Inherits:
-
Object
- Object
- Sqed::Parser
- Defined in:
- lib/sqed/parser.rb
Overview
Base class for Parsers
Direct Known Subclasses
Defined Under Namespace
Classes: BarcodeParser, OcrParser
Instance Attribute Summary collapse
-
#extracted_text ⇒ Object
Returns the value of attribute extracted_text.
-
#image ⇒ Object
Returns the value of attribute image.
Instance Method Summary collapse
-
#initialize(image) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(image) ⇒ Parser
Returns a new instance of Parser.
11 12 13 14 15 |
# File 'lib/sqed/parser.rb', line 11 def initialize(image) raise Sqed::Error, 'no image passed to parser' if image.nil? raise Sqed::Error, 'image is not a Magick::Image' if !(image.class.name == 'Magick::Image') @image = image end |
Instance Attribute Details
#extracted_text ⇒ Object
Returns the value of attribute extracted_text.
9 10 11 |
# File 'lib/sqed/parser.rb', line 9 def extracted_text @extracted_text end |
#image ⇒ Object
Returns the value of attribute image.
7 8 9 |
# File 'lib/sqed/parser.rb', line 7 def image @image end |