class Bio::Hinv::KeywordSearch

serv = ::new serv.query(“query” => “HIT00002218*”, “start” => 1, “end” => 100) puts serv.result puts serv.size puts serv.start puts serv.end

Public Class Methods

new() click to toggle source
# File lib/bio/io/hinv.rb, line 370
def initialize
  @url = BASE_URI + "keyword_search.php"
end

Public Instance Methods

end() click to toggle source
# File lib/bio/io/hinv.rb, line 412
def end
  @xml.elements['//END'].text.to_i
end
query(hash = {}) click to toggle source
Calls superclass method Bio::Hinv::Common#query
# File lib/bio/io/hinv.rb, line 374
def query(hash = {})
  default = {
    "start" => 1,
    "end" => 100
  }
  options = default.update(hash)
  super(options)
end
result() click to toggle source

<?xml version='1.0' encoding='UTF-8'?> <HINVDB_SEARCH>

<QUERY>HIT00002218*</QUERY>
<SIZE>8</SIZE>
<START>1</START>
<END>8</END>
<H-INVITATIONAL-ID>HIT000022180</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022181</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022183</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022184</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022185</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022186</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022188</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022189</H-INVITATIONAL-ID>

</HINVDB_SEARCH>

# File lib/bio/io/hinv.rb, line 398
def result
  list = []
  @xml.elements.each('//H-INVITATIONAL-ID') do |e|
    list << e.text
  end
  return list
end
size() click to toggle source
# File lib/bio/io/hinv.rb, line 406
def size
  @xml.elements['//SIZE'].text.to_i
end
start() click to toggle source
# File lib/bio/io/hinv.rb, line 409
def start
  @xml.elements['//START'].text.to_i
end