Method: Bio::TogoWS::REST#initialize

Defined in:
lib/bio/io/togows.rb

#initialize(uri = BASE_URI) ⇒ REST

Creates a new object.


Arguments:

  • (optional) uri: String or URI object

Returns

new object



141
142
143
144
145
146
147
148
149
150
151
# File 'lib/bio/io/togows.rb', line 141

def initialize(uri = BASE_URI)
  uri = URI.parse(uri) unless uri.kind_of?(URI)
  @pathbase = uri.path
  @pathbase = '/' + @pathbase unless /\A\// =~ @pathbase
  @pathbase = @pathbase + '/' unless /\/\z/ =~ @pathbase
  @http = Bio::Command.new_http(uri.host, uri.port)
  @header = {
    'User-Agent' => "BioRuby/#{Bio::BIORUBY_VERSION_ID}"
  }
  @debug = false
end