Sha256: d08775a5db107d24cbff0fc09c141d3ae8a7d5fccc9ac02b75c54f36ae4e39c5
Contents?: true
Size: 553 Bytes
Versions: 13
Compression:
Stored size: 553 Bytes
Contents
class NSError # @example # NSError.error('just a simple error message') # NSError.error('just a simple error message', # domain: 'foo', # code: 255, # userInfo: { 'object' => 'foo' } # ) def self.error(message='Error', options={}) domain = options[:domain] || 'Error' code = options[:code] || 0 info = { NSLocalizedDescriptionKey => message } if options[:userInfo] info.merge! options[:userInfo] end NSError.alloc.initWithDomain(domain, code: code, userInfo: info) end end
Version data entries
13 entries across 13 versions & 1 rubygems