Class: Snake::BodyPart

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/snake.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position, vector) ⇒ BodyPart

Returns a new instance of BodyPart.



29
30
31
32
# File 'lib/snake.rb', line 29

def initialize(position, vector)
  @position = position
  @vector = vector
end

Instance Attribute Details

#positionObject

Returns the value of attribute position.



28
29
30
# File 'lib/snake.rb', line 28

def position
  @position
end

#vectorObject

Returns the value of attribute vector.



28
29
30
# File 'lib/snake.rb', line 28

def vector
  @vector
end