Sha256: aa080236549df2af6384a1c0a36ec0deec0a90331d1ebe7955ad9df5db5091b7
Contents?: true
Size: 696 Bytes
Versions: 6
Compression:
Stored size: 696 Bytes
Contents
class Skein::RPC::Error < Skein::RPC::Base # == Properties =========================================================== attr_accessor :error # == Instance Methods ===================================================== def initialize(content = nil) case (content) when String self.error = content when Hash self.assign_from_hash!(content) when nil # Defaults else raise Skein::RPC::Exception, 'Invalid type: %s' % content.class end end def self.to_h { result: nil, error: self.error, id: self.id } end protected def assign_from_hash!(hash) self.error = hash[:error] self.id = hash[:id] end end
Version data entries
6 entries across 6 versions & 1 rubygems