ruby: 3 level method define