Class: Snake::BodyPart
Instance Attribute Summary collapse
-
#position ⇒ Object
Returns the value of attribute position.
-
#vector ⇒ Object
Returns the value of attribute vector.
Instance Method Summary collapse
-
#initialize(position, vector) ⇒ BodyPart
constructor
A new instance of BodyPart.
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
#position ⇒ Object
Returns the value of attribute position.
28 29 30 |
# File 'lib/snake.rb', line 28 def position @position end |
#vector ⇒ Object
Returns the value of attribute vector.
28 29 30 |
# File 'lib/snake.rb', line 28 def vector @vector end |