Skip to content

Instantly share code, notes, and snippets.

@vcolavin
Created July 21, 2016 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcolavin/d05fc94e3b6e1c3240e2ea43784801bb to your computer and use it in GitHub Desktop.
Save vcolavin/d05fc94e3b6e1c3240e2ea43784801bb to your computer and use it in GitHub Desktop.
class Wolf < AR::Base
include Movable
end
module Movable
def some_movement_method
# like maybe accessors for Location relation
end
end
module Mover # or Map or something
def self.move!(movable)
# ...
movable.location = some_new_location
# ...
end
end
Mover.move!(Wolf.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment