class Platon::Singleton

Attributes

client[RW]
default_account[RW]
host[RW]
instance[RW]
ipcpath[RW]
log[RW]

Public Class Methods

reset() click to toggle source
# File lib/platon/singleton.rb, line 15
def reset
  @instance = nil
  @client = nil
  @host = nil
  @log = nil
  @ipcpath = nil
  @default_account = nil
end
setup() { |self| ... } click to toggle source
# File lib/platon/singleton.rb, line 11
def setup
  yield(self)
end

Private Class Methods

configure_instance(instance) click to toggle source
# File lib/platon/singleton.rb, line 31
def configure_instance(instance)
  instance.tap do |i|
    i.default_account = @default_account if @default_account.present?
  end
end
create_instance() click to toggle source
# File lib/platon/singleton.rb, line 25
def create_instance
  return Platon::IpcClient.new(@ipcpath) if @client == :ipc 
  return Platon::HttpClient.new(@host) if @client == :http
  Platon::IpcClient.new
end