-
Notifications
You must be signed in to change notification settings - Fork 1
Trait: Shot
floere edited this page Sep 14, 2010
·
1 revision
Shot is about bullets, guns, rockets, live chicken. It is about things that are shot from a Shooter
.
The Shot trait can be applied as usual:
class Bullet < Thing
it_is_a Shot
or
class Bullet < Thing
it_is_a Shot do
# …
end
Shot has no specific property.
Normally you don’t need any of these methods. Just use the shot together with a Shooter
.
Shot installs five methods: shoot_from
, velocity
, velocity=
, originator
, and originator=
.
it mainly installs the shoot_from <shooter>
method so the shot can be used together with a Shooter
.
The originator
accessors can be used to get or set the originator.