Exception: Electrb::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/electrb.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/electrb.rb', line 8

def id
  @id
end

#jsonrpcObject

Returns the value of attribute jsonrpc.



9
10
11
# File 'lib/electrb.rb', line 9

def jsonrpc
  @jsonrpc
end

Class Method Details

.from(hash) ⇒ Electrb::Error

generate error form hash.

Parameters:

  • hash of error.

Returns:



14
15
16
17
18
19
# File 'lib/electrb.rb', line 14

def self.from(hash)
  e = Electrb::Error.new(hash['error'])
  e.id = hash['id']
  e.jsonrpc = hash['jsonrpc']
  e
end