Method: Attributor::URI.load
- Defined in:
- lib/attributor/types/uri.rb
.load(value, context = Attributor::DEFAULT_ROOT_CONTEXT, **_options) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/attributor/types/uri.rb', line 37 def self.load(value, context = Attributor::DEFAULT_ROOT_CONTEXT, **) return nil if value.nil? case value when native_type value when ::String URI(value) else raise CoercionError.new(context: context, from: value.class, to: self, value: value) end end |