Class: Haversack::Item
- Inherits:
-
Object
- Object
- Haversack::Item
- Defined in:
- lib/haversack/item.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#size ⇒ Object
Returns the value of attribute size.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(weight: 1, size: 1, data: nil) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(weight: 1, size: 1, data: nil) ⇒ Item
Returns a new instance of Item.
7 8 9 10 11 |
# File 'lib/haversack/item.rb', line 7 def initialize(weight: 1, size: 1, data: nil) @weight = weight @size = size @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/haversack/item.rb', line 5 def data @data end |
#size ⇒ Object
Returns the value of attribute size.
4 5 6 |
# File 'lib/haversack/item.rb', line 4 def size @size end |
#weight ⇒ Object
Returns the value of attribute weight.
3 4 5 |
# File 'lib/haversack/item.rb', line 3 def weight @weight end |