class Geong::Client

Constants

DEFAULT_HOST
DEFAULT_PORT

Attributes

protocol[R]
transport[R]

Public Class Methods

default_protocol(transport, options) click to toggle source
# File lib/geong/client.rb, line 19
def self.default_protocol(transport, options)
  Thrift::BinaryProtocol.new(transport)
end
default_transport(options) click to toggle source
# File lib/geong/client.rb, line 15
def self.default_transport(options)
  Thrift::FramedTransport.new(Thrift::Socket.new(options[:host] || DEFAULT_HOST, options[:port] || DEFAULT_PORT))
end
new(options = {}) click to toggle source
# File lib/geong/client.rb, line 9
def initialize(options = {})
  @transport = options[:transport] || self.class.default_transport(options)
  @protocol =  options[:protocol ] || self.class.default_protocol(@transport, options)
  @client = Geong::Geocoder::GeocoderService::Client.new(@protocol)
end

Public Instance Methods

close() click to toggle source
# File lib/geong/client.rb, line 32
def close
  @transport.close
  self
end
closed?() click to toggle source
# File lib/geong/client.rb, line 37
def closed?
  @transport.closed?
end
method_missing(*args, &block) click to toggle source
# File lib/geong/client.rb, line 45
def method_missing(*args, &block)
  @client.send(*args, &block)
end
open() click to toggle source
# File lib/geong/client.rb, line 23
def open
  @transport.open
  self
end
open?() click to toggle source
# File lib/geong/client.rb, line 28
def open?
  @transport.open?
end
respond_to_missing?(method, include_private) click to toggle source
# File lib/geong/client.rb, line 41
def respond_to_missing?(method, include_private)
  @client.respond_to?(method, include_private)
end