Class: Alula::RpcResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/alula/rpc_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RpcResponse

Returns a new instance of RpcResponse.



5
6
7
8
# File 'lib/alula/rpc_response.rb', line 5

def initialize(response)
  @request_id = response.data['id']
  @result = response.data['result']
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/alula/rpc_response.rb', line 3

def data
  @data
end

#request_idObject

Returns the value of attribute request_id.



3
4
5
# File 'lib/alula/rpc_response.rb', line 3

def request_id
  @request_id
end

#resultObject

Returns the value of attribute result.



3
4
5
# File 'lib/alula/rpc_response.rb', line 3

def result
  @result
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/alula/rpc_response.rb', line 10

def ok?
  @result['success'] == true || (@result['errors'].nil? && @result['error'].nil?)
end