Class: Sqed::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/sqed/parser.rb

Overview

Base class for Parsers

Direct Known Subclasses

BarcodeParser, OcrParser

Defined Under Namespace

Classes: BarcodeParser, OcrParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image) ⇒ Parser

Returns a new instance of Parser.

Raises:



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_textObject

Returns the value of attribute extracted_text.



9
10
11
# File 'lib/sqed/parser.rb', line 9

def extracted_text
  @extracted_text
end

#imageObject

Returns the value of attribute image.



7
8
9
# File 'lib/sqed/parser.rb', line 7

def image
  @image
end