Class: BarcodeValidation::InvalidGTIN
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- BarcodeValidation::InvalidGTIN
- Defined in:
- lib/barcodevalidation/invalid_gtin.rb
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(input, error: nil) ⇒ InvalidGTIN
constructor
A new instance of InvalidGTIN.
- #inspect ⇒ Object
- #to_all_valid ⇒ Object
- #to_gtin_12 ⇒ Object
- #to_gtin_13 ⇒ Object
- #to_gtin_14 ⇒ Object
- #to_gtin_8 ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(input, error: nil) ⇒ InvalidGTIN
Returns a new instance of InvalidGTIN.
7 8 9 10 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 7 def initialize(input, error: nil) @error = error super(input) end |
Instance Method Details
#error_message ⇒ Object
20 21 22 23 24 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 20 def return @error. if @error.respond_to? :message @error.inspect end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 16 def inspect %(#<#{self.class} input=#{super} error="#{}">) end |
#to_all_valid ⇒ Object
26 27 28 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 26 def to_all_valid [] end |
#to_gtin_12 ⇒ Object
34 35 36 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 34 def to_gtin_12 self end |
#to_gtin_13 ⇒ Object
38 39 40 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 38 def to_gtin_13 self end |
#to_gtin_14 ⇒ Object
42 43 44 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 42 def to_gtin_14 self end |
#to_gtin_8 ⇒ Object
30 31 32 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 30 def to_gtin_8 self end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 12 def valid? false end |