Class: AAMVA::Encoder
- Inherits:
-
Object
- Object
- AAMVA::Encoder
- Defined in:
- lib/aamva/encoder.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#standard ⇒ Object
readonly
Returns the value of attribute standard.
Instance Method Summary collapse
-
#initialize(standard:, data:) ⇒ Encoder
constructor
A new instance of Encoder.
- #pdf417 ⇒ Object
- #png ⇒ Object
- #string ⇒ Object
Constructor Details
#initialize(standard:, data:) ⇒ Encoder
Returns a new instance of Encoder.
5 6 7 8 |
# File 'lib/aamva/encoder.rb', line 5 def initialize(standard:, data:) @standard = standard @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/aamva/encoder.rb', line 3 def data @data end |
#standard ⇒ Object (readonly)
Returns the value of attribute standard.
3 4 5 |
# File 'lib/aamva/encoder.rb', line 3 def standard @standard end |
Instance Method Details
#pdf417 ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/aamva/encoder.rb', line 14 def pdf417 @pdf417 ||= begin require "pdf417" PDF417.new(string) end end |
#png ⇒ Object
22 23 24 |
# File 'lib/aamva/encoder.rb', line 22 def png @png ||= pdf417.to_chunky_png end |
#string ⇒ Object
10 11 12 |
# File 'lib/aamva/encoder.rb', line 10 def string "#{header}#{subfile_designators}#{subfiles}" end |