Class: JSONRPC::Client
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#class, #initialize, #inspect, make_id, #to_s
Constructor Details
This class inherits a constructor from JSONRPC::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
144 145 146 |
# File 'lib/jsonrpc/client.rb', line 144 def method_missing(method, *args, &block) invoke(method, args) end |
Instance Method Details
#invoke(method, args, options = nil) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/jsonrpc/client.rb', line 148 def invoke(method, args, = nil) resp = send_single_request(method.to_s, args, ) begin data = ::MultiJson.decode(resp, ::JSONRPC.) rescue raise ::JSONRPC::Error::InvalidJSON.new(resp) end process_single_response(data) rescue => e e.extend(::JSONRPC::Error) raise end |