Module: Jeth
- Defined in:
- lib/jeth.rb,
lib/jeth/util.rb,
lib/jeth/client.rb,
lib/jeth/version.rb,
lib/jeth/ipc_client.rb,
lib/jeth/http_client.rb
Defined Under Namespace
Classes: Client, HttpClient, IpcClient, Util
Constant Summary collapse
- VERSION =
"0.0.11"
Class Method Summary collapse
Class Method Details
.create(host_or_ipcpath = nil) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/jeth.rb', line 8 def self.create(host_or_ipcpath = nil) return IpcClient.new if host_or_ipcpath.nil? return IpcClient.new(host_or_ipcpath) if host_or_ipcpath.end_with? '.ipc' return HttpClient.new(host_or_ipcpath) if host_or_ipcpath.start_with? 'http' raise ArgumentError.new('Unable to detect client type. Please use "http://host:port" or "/path/to/geth.ipc".') end |