Class: Sqed::Parser::BarcodeParser
- Inherits:
-
Sqed::Parser
- Object
- Sqed::Parser
- Sqed::Parser::BarcodeParser
- Defined in:
- lib/sqed/parser/barcode_parser.rb
Overview
Given an image, return an ordered array of detectable barcodes
!! DOES NOTHING !!
Constant Summary collapse
- TYPE =
:barcode
Instance Attribute Summary collapse
-
#barcode ⇒ Object
Returns the value of attribute barcode.
Attributes inherited from Sqed::Parser
Instance Method Summary collapse
-
#get_barcode ⇒ Object
try a bunch of options, organized by most common, give the first hit.
-
#get_code_128 ⇒ Object
Uses the same engine as zbarimg that you can install with brew (zbarimg).
-
#get_text(section_type: :default) ⇒ Object
alias to a universal method.
-
#initialize(image) ⇒ BarcodeParser
constructor
A new instance of BarcodeParser.
Constructor Details
#initialize(image) ⇒ BarcodeParser
Returns a new instance of BarcodeParser.
11 12 13 14 |
# File 'lib/sqed/parser/barcode_parser.rb', line 11 def initialize(image) super @image = image end |
Instance Attribute Details
#barcode ⇒ Object
Returns the value of attribute barcode.
9 10 11 |
# File 'lib/sqed/parser/barcode_parser.rb', line 9 def @barcode end |
Instance Method Details
#get_barcode ⇒ Object
try a bunch of options, organized by most common, give the first hit
28 29 30 |
# File 'lib/sqed/parser/barcode_parser.rb', line 28 def [get_code_128].compact.first end |
#get_code_128 ⇒ Object
Uses the same engine as zbarimg that you can install with brew (zbarimg)
23 24 25 |
# File 'lib/sqed/parser/barcode_parser.rb', line 23 def get_code_128 nil # ZXing.decode @image.filename end |
#get_text(section_type: :default) ⇒ Object
alias to a universal method
37 38 39 |
# File 'lib/sqed/parser/barcode_parser.rb', line 37 def get_text(section_type: :default) end |