Class: Warehouse::Item::Barcode
- Defined in:
- lib/warehouse/item/barcode.rb
Instance Attribute Summary
Attributes inherited from Base
#code_or_barcode, #code_type, #items, #price, #qty, #title
Instance Method Summary collapse
- #barcode ⇒ Object
- #code ⇒ Object
-
#initialize ⇒ Barcode
constructor
A new instance of Barcode.
- #to_h ⇒ Object
Methods inherited from Base
#barcode?, #code?, #deep_dup, #persisted?, #product, #random?, #single?, #type
Constructor Details
#initialize ⇒ Barcode
Returns a new instance of Barcode.
4 5 6 7 |
# File 'lib/warehouse/item/barcode.rb', line 4 def initialize(*) super self.code_type = :barcode end |
Instance Method Details
#barcode ⇒ Object
9 10 11 |
# File 'lib/warehouse/item/barcode.rb', line 9 def end |
#code ⇒ Object
13 14 15 |
# File 'lib/warehouse/item/barcode.rb', line 13 def code raise NoMethodError, "use #barcode instead." end |
#to_h ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/warehouse/item/barcode.rb', line 17 def to_h { 'barcode' => , 'title' => title, 'qty' => qty } end |