Class: JSONRPC::Helper
- Inherits:
-
Object
- Object
- JSONRPC::Helper
- Defined in:
- lib/jsonrpc/client.rb
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(options) ⇒ Helper
constructor
A new instance of Helper.
- #options(additional_options = nil) ⇒ Object
Constructor Details
#initialize(options) ⇒ Helper
Returns a new instance of Helper.
29 30 31 32 33 |
# File 'lib/jsonrpc/client.rb', line 29 def initialize() = [:content_type] ||= 'application/json' @connection = .delete(:connection) end |
Instance Method Details
#connection ⇒ Object
43 44 45 46 47 48 |
# File 'lib/jsonrpc/client.rb', line 43 def connection @connection || ::Faraday.new { |connection| connection.response :logger, ::JSONRPC.logger connection.adapter ::Faraday.default_adapter } end |
#options(additional_options = nil) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/jsonrpc/client.rb', line 35 def ( = nil) if .merge() else end end |