Class: Warehouse::Item::Base
- Inherits:
-
Struct
- Object
- Struct
- Warehouse::Item::Base
- Defined in:
- lib/warehouse/item/base.rb
Instance Attribute Summary collapse
-
#code_or_barcode ⇒ Object
Returns the value of attribute code_or_barcode.
-
#code_type ⇒ Object
Returns the value of attribute code_type.
-
#items ⇒ Object
Returns the value of attribute items.
-
#price ⇒ Object
Returns the value of attribute price.
-
#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
- #type ⇒ Object
Instance Attribute Details
#code_or_barcode ⇒ Object
Returns the value of attribute code_or_barcode
3 4 5 |
# File 'lib/warehouse/item/base.rb', line 3 def @code_or_barcode end |
#code_type ⇒ Object
Returns the value of attribute code_type.
4 5 6 |
# File 'lib/warehouse/item/base.rb', line 4 def code_type @code_type end |
#items ⇒ Object
Returns the value of attribute items.
5 6 7 |
# File 'lib/warehouse/item/base.rb', line 5 def items @items end |
#price ⇒ Object
Returns the value of attribute price
3 4 5 |
# File 'lib/warehouse/item/base.rb', line 3 def price @price end |
#qty ⇒ Object
Returns the value of attribute qty
3 4 5 |
# File 'lib/warehouse/item/base.rb', line 3 def qty @qty end |
#title ⇒ Object
Returns the value of attribute title
3 4 5 |
# File 'lib/warehouse/item/base.rb', line 3 def title @title end |
Instance Method Details
#barcode? ⇒ Boolean
7 8 9 |
# File 'lib/warehouse/item/base.rb', line 7 def code_type == :barcode end |
#code? ⇒ Boolean
11 12 13 |
# File 'lib/warehouse/item/base.rb', line 11 def code? code_type == :code end |
#deep_dup ⇒ Object
27 28 29 |
# File 'lib/warehouse/item/base.rb', line 27 def deep_dup self.class.new(, title, qty, price) end |
#persisted? ⇒ Boolean
給 form 用的
32 |
# File 'lib/warehouse/item/base.rb', line 32 def persisted?; false end |
#product ⇒ Object
33 |
# File 'lib/warehouse/item/base.rb', line 33 def product; end |
#random? ⇒ Boolean
19 20 21 |
# File 'lib/warehouse/item/base.rb', line 19 def random? false end |
#single? ⇒ Boolean
23 24 25 |
# File 'lib/warehouse/item/base.rb', line 23 def single? true end |
#type ⇒ Object
15 16 17 |
# File 'lib/warehouse/item/base.rb', line 15 def type 'single' end |