Sha256: 04bf6ae1cec1219f83110c64277ac5c1e41833aceae97c053f06f09a42d35845

Contents?: true

Size: 343 Bytes

Versions: 1

Compression:

Stored size: 343 Bytes

Contents

module Abstracta
  class Occupant
    extend Forwardable
    attr_reader :age
    attr_reader :location
    def_delegators :location, :zip, :x, :y

    def initialize(location=[0,0])
      @location = location
      @age      = 0
      @size     = 1
    end

    def position; [@x,@y] end

    def step
      @age = @age + 1
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abstracta-0.1.1 lib/abstracta/occupant.rb