Sha256: afd9a1e78a7d9a913d679e83b307619e4a22d8d94a4d59fda2f79bc3008a7a34

Contents?: true

Size: 810 Bytes

Versions: 1

Compression:

Stored size: 810 Bytes

Contents

class StartcoinClient::API
  attr_reader :options
  attr_reader :params

  def user; options[:user]; end
  def pass; options[:pass]; end
  def host; options[:host]; end
  def port; options[:port]; end
  def ssl;  options[:ssl];  end
  def ssl?; options[:ssl];  end
  def user=(a); options[:user] = a; end
  def pass=(a); options[:pass] = a; end
  def host=(a); options[:host] = a; end
  def port=(a); options[:port] = a; end
  def ssl=(a);  options[:ssl]  = a; end

  def initialize(options = {})
    @options = {
      :host => 'localhost',
      :port => 8332,
      :ssl  => false
    }.merge(options)
  end

  def to_hash
    @options.dup
  end

  def request(service_name, *params)
    req = StartcoinClient::Request.new(service_name, params)
    StartcoinClient::RPC.new(to_hash).dispatch(req)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
startcoin-client-0.0.3 lib/startcoin_client/api.rb