Method: Object#param_class
- Defined in:
- lib/y_support/core_ext/object/misc.rb
#param_class(hash, with: (fail ArgumentError, "No parameters!")) ⇒ Object
Constructs parametrized subclasses of the supplied classes and makes them available under specified getters. Expects a hash of pairs { reader_symbol: class }, and a hash of parameters, with which the class(es) is (are) parametrized. Raises NameError should any of the getters shadow / overwrite existing methods.
33 34 35 36 37 38 39 |
# File 'lib/y_support/core_ext/object/misc.rb', line 33 def param_class hash, with: (fail ArgumentError, "No parameters!") hash.each { | |