Class: Barcode::FormatHandlers::SangerBase
- Inherits:
-
Object
- Object
- Barcode::FormatHandlers::SangerBase
show all
- Defined in:
- app/models/barcode/format_handlers.rb
Overview
Base Sequencescape barcode This class mostly wraps the SBCF Gem
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(barcode) ⇒ SangerBase
Returns a new instance of SangerBase.
26
27
28
|
# File 'app/models/barcode/format_handlers.rb', line 26
def initialize(barcode)
@barcode_object = SBCF::SangerBarcode.from_human(barcode)
end
|
Instance Attribute Details
#barcode_object ⇒ Object
Returns the value of attribute barcode_object.
24
25
26
|
# File 'app/models/barcode/format_handlers.rb', line 24
def barcode_object
@barcode_object
end
|
Instance Method Details
#barcode_prefix ⇒ Object
55
56
57
|
# File 'app/models/barcode/format_handlers.rb', line 55
def barcode_prefix
prefix.human
end
|
#code128_barcode? ⇒ Boolean
51
52
53
|
# File 'app/models/barcode/format_handlers.rb', line 51
def code128_barcode?
true
end
|
#code39_barcode? ⇒ Boolean
43
44
45
|
# File 'app/models/barcode/format_handlers.rb', line 43
def code39_barcode?
true
end
|
#ean13_barcode ⇒ Object
The gem was yielding integers for backward compatible reasons. We’ll convert for the time being, but should probably fix that.
35
36
37
|
# File 'app/models/barcode/format_handlers.rb', line 35
def ean13_barcode
barcode_object.machine_barcode.to_s
end
|
#ean13_barcode? ⇒ Boolean
39
40
41
|
# File 'app/models/barcode/format_handlers.rb', line 39
def ean13_barcode?
true
end
|
#number_as_string ⇒ Object
47
48
49
|
# File 'app/models/barcode/format_handlers.rb', line 47
def number_as_string
number.to_s
end
|