Class: Warehouse::Item::Barcode
- Inherits:
-
Struct
- Object
- Struct
- Warehouse::Item::Barcode
- Defined in:
- lib/warehouse/item/barcode.rb
Instance Attribute Summary collapse
-
#barcode ⇒ Object
Returns the value of attribute barcode.
-
#qty ⇒ Object
Returns the value of attribute qty.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #barcode? ⇒ Boolean
- #code? ⇒ Boolean
- #deep_dup ⇒ Object
-
#persisted? ⇒ Boolean
給 form 用的.
- #product ⇒ Object
- #random? ⇒ Boolean
- #single? ⇒ Boolean
- #to_h ⇒ Object
- #type ⇒ Object
Instance Attribute Details
#barcode ⇒ Object
Returns the value of attribute barcode
3 4 5 |
# File 'lib/warehouse/item/barcode.rb', line 3 def @barcode end |
#qty ⇒ Object
Returns the value of attribute qty
3 4 5 |
# File 'lib/warehouse/item/barcode.rb', line 3 def qty @qty end |
#title ⇒ Object
Returns the value of attribute title
3 4 5 |
# File 'lib/warehouse/item/barcode.rb', line 3 def title @title end |
Instance Method Details
#barcode? ⇒ Boolean
5 6 7 |
# File 'lib/warehouse/item/barcode.rb', line 5 def true end |
#code? ⇒ Boolean
9 10 11 |
# File 'lib/warehouse/item/barcode.rb', line 9 def code? false end |
#deep_dup ⇒ Object
33 34 35 |
# File 'lib/warehouse/item/barcode.rb', line 33 def deep_dup self.class.new(, title, qty) end |
#persisted? ⇒ Boolean
給 form 用的
38 |
# File 'lib/warehouse/item/barcode.rb', line 38 def persisted?; false end |
#product ⇒ Object
39 |
# File 'lib/warehouse/item/barcode.rb', line 39 def product; end |
#random? ⇒ Boolean
17 18 19 |
# File 'lib/warehouse/item/barcode.rb', line 17 def random? false end |
#single? ⇒ Boolean
21 22 23 |
# File 'lib/warehouse/item/barcode.rb', line 21 def single? true end |
#to_h ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/warehouse/item/barcode.rb', line 25 def to_h { 'barcode' => , 'title' => title, 'qty' => qty } end |
#type ⇒ Object
13 14 15 |
# File 'lib/warehouse/item/barcode.rb', line 13 def type 'single' end |