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
- #valid? ⇒ Boolean
Constructor Details
#initialize(input, error: nil) ⇒ InvalidGTIN
Returns a new instance of InvalidGTIN.
5 6 7 8 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 5 def initialize(input, error: nil) @error = error super(input) end |
Instance Method Details
#error_message ⇒ Object
18 19 20 21 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 18 def return @error. if @error.respond_to? :message @error.inspect end |
#inspect ⇒ Object
14 15 16 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 14 def inspect %(#<#{self.class} input=#{super} error="#{error_message}">) end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/barcodevalidation/invalid_gtin.rb', line 10 def valid? false end |