Programming Ruby 3.2 (5th Edition): B4.0 page 593, delegated to the parameter class

page 593 bottom, in the line before ref_meta_ruby/delegate_class.rb
pass the object to be delegated to the parameter class
is unclear (at least at first glance). I had to do some research. Without super
.../delegate.rb:405:in '__getobj__': not delegated (ArgumentError)
So calling super
is crucial. I would say something like that :
In the new class’s initialize method, call super
with the object to be delegated to the delegated class (the one given as parameter to DelegateClass).
or
In the new class’s initialize method, call super
with the object to be delegated to the class given as parameter to DelegateClass.
or closer to your sentence :
In the new class’s initialize method, call super
with the object to be delegated to this class (the parameter to DelegateClass).
Popular Prag Prog topics










Other popular topics








Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /security
- /django
- /nodejs
- /centos
- /haskell
- /rails
- /fable
- /gleam
- /swift
- /js
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /flutter
- /c-plus-plus
- /preact
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /nim
- /vuejs
- /emacs
- /elm
- /nerves