lib/traits/turnable.rb in gosu_extensions-0.1.14 vs lib/traits/turnable.rb in gosu_extensions-0.1.15
- old
+ new
@@ -1,16 +1,19 @@
#
#
-module Turnable
+module Turnable extend Trait
Left = :turn_left
Right = :turn_right
def self.included base
base.extend ClassMethods
end
- # TODO meta
+ # Defines a turn_speed method on the class.
+ #
+ # Calling it will define a turn_speed method on the instance
+ # that lets the thing rotate with the given frequency.
#
module ClassMethods
def turn_speed amount
amount = amount.to_f / 2
define_method :turn_speed do
\ No newline at end of file