doc: sample: switch to kebab-case
This commit is contained in:
@@ -3,8 +3,8 @@ package net.doorstuck.vehicles
|
||||
protocol Vehicle
|
||||
- startup
|
||||
- shutdown
|
||||
- nrWheels
|
||||
- nrDoors
|
||||
- nr-wheels
|
||||
- nr-doors
|
||||
- turn(direction:dir)
|
||||
- accelerate(direction:dir)
|
||||
- velocity
|
||||
@@ -12,33 +12,33 @@ end
|
||||
|
||||
class Car <Vehicle>
|
||||
- startup
|
||||
self.engineRunning = true
|
||||
self.engine-running = true
|
||||
end
|
||||
|
||||
- shutdown
|
||||
self.engineRunning = false
|
||||
self.engine-running = false
|
||||
end
|
||||
|
||||
- nrWheels
|
||||
- nr-wheels
|
||||
^4
|
||||
end
|
||||
|
||||
- nrDoors
|
||||
- nr-doors
|
||||
^4
|
||||
end
|
||||
|
||||
- turn(direction:dir)
|
||||
self.currentDirection = dir
|
||||
self.current-direction = dir
|
||||
end
|
||||
|
||||
- accelerate(direction:dir)
|
||||
match dir
|
||||
#forward => self.currentVelocity += 1,
|
||||
#backward => self.currentVelocity -= 1,
|
||||
$forward => self.current-velocity += 1,
|
||||
$backward => self.current-velocity -= 1,
|
||||
end
|
||||
end
|
||||
|
||||
- velicity
|
||||
^self.currentVelocity
|
||||
- velocity
|
||||
^self.current-velocity
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user