class Abstracta::Occupant
Attributes
age[R]
location[R]
Public Class Methods
new(location=[0,0])
click to toggle source
# File lib/abstracta/occupant.rb, line 8 def initialize(location=[0,0]) @location = location @age = 0 @size = 1 end
Public Instance Methods
position()
click to toggle source
# File lib/abstracta/occupant.rb, line 14 def position; [@x,@y] end
step()
click to toggle source
# File lib/abstracta/occupant.rb, line 16 def step @age = @age + 1 end