Class: ZXing::Decoder
- Inherits:
-
Object
- Object
- ZXing::Decoder
- Defined in:
- lib/zxing/decoder.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
Class Method Summary collapse
Instance Method Summary collapse
- #decode ⇒ Object
-
#initialize(file) ⇒ Decoder
constructor
A new instance of Decoder.
Constructor Details
#initialize(file) ⇒ Decoder
Returns a new instance of Decoder.
37 38 39 |
# File 'lib/zxing/decoder.rb', line 37 def initialize(file) self.file = file end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
23 24 25 |
# File 'lib/zxing/decoder.rb', line 23 def file @file end |
Class Method Details
.decode(file) ⇒ Object
31 32 33 34 35 |
# File 'lib/zxing/decoder.rb', line 31 def self.decode(file) decode!(file) rescue UndecodableError nil end |
.decode!(file) ⇒ Object
25 26 27 28 29 |
# File 'lib/zxing/decoder.rb', line 25 def self.decode!(file) new(file).decode rescue NativeException raise UndecodableError end |
Instance Method Details
#decode ⇒ Object
41 42 43 |
# File 'lib/zxing/decoder.rb', line 41 def decode MultiFormatReader.new.decode(bitmap).to_s end |