0

Adapter Pseudo code - peg.radius()

Jugesh Sundram 3 months ago 0

https://refactoring.guru/design-patterns/adapter

class RoundHole is
    constructor RoundHole(radius) { ... }

    method getRadius() is
        // Return the radius of the hole.

    method fits(peg: RoundPeg) is
        return this.getRadius() >= peg.radius()


Shouldn't peg.radius() be peg.getRadius()?