Method: Attributor.resolve_type
- Defined in:
- lib/attributor.rb
.resolve_type(attr_type, options = {}, constructor_block = nil) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/attributor.rb', line 26 def self.resolve_type(attr_type, = {}, constructor_block = nil) klass = self.find_type(attr_type) return klass.construct(constructor_block, **) if klass.constructable? raise AttributorException, "Type: #{attr_type} does not support anonymous generation" if constructor_block klass end |