Class: PLU
- Inherits:
-
Ohm::Model
- Object
- Ohm::Model
- PLU
- Defined in:
- lib/porp/plu.rb
Overview
The PLU class provides Product Look Ups. The Lookup can be a barcode number or any other string identifier. Each lookup can be associated with exactly one Stock, Sale, or Purchase Entity
Class Method Summary (collapse)
Instance Method Summary (collapse)
Class Method Details
+ (Object) lookup(lookup_value)
17 18 19 |
# File 'lib/porp/plu.rb', line 17 def self.lookup(lookup_value) find(value: lookup_value.to_s).first end |
Instance Method Details
- (Object) to_s
25 26 27 |
# File 'lib/porp/plu.rb', line 25 def to_s value.to_s end |
- (Object) validate
21 22 23 |
# File 'lib/porp/plu.rb', line 21 def validate assert_unique :value end |