Class: Haversack::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/haversack/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/haversack/item.rb', line 5

def data
  @data
end

#sizeObject

Returns the value of attribute size.



4
5
6
# File 'lib/haversack/item.rb', line 4

def size
  @size
end

#weightObject

Returns the value of attribute weight.



3
4
5
# File 'lib/haversack/item.rb', line 3

def weight
  @weight
end