Class: Bio::Hinv::KeywordSearch
- Inherits:
-
Object
- Object
- Bio::Hinv::KeywordSearch
- Includes:
- Common
- Defined in:
- lib/bio/io/hinv.rb
Overview
serv = Bio::Hinv::KeywordSearch.new serv.query("query" => "HIT00002218*", "start" => 1, "end" => 100) puts serv.result puts serv.size puts serv.start puts serv.end
Direct Known Subclasses
Instance Method Summary collapse
- #end ⇒ Object
-
#initialize ⇒ KeywordSearch
constructor
A new instance of KeywordSearch.
- #query(hash = {}) ⇒ Object
-
#result ⇒ Object
.HIT00002218* 8 1 8 HIT000022180 HIT000022181 HIT000022183 HIT000022184 HIT000022185 HIT000022186 HIT000022188 HIT000022189 - #size ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ KeywordSearch
Returns a new instance of KeywordSearch.
370 371 372 |
# File 'lib/bio/io/hinv.rb', line 370 def initialize @url = BASE_URI + "keyword_search.php" end |
Instance Method Details
#end ⇒ Object
412 413 414 |
# File 'lib/bio/io/hinv.rb', line 412 def end @xml.elements['//END'].text.to_i end |
#query(hash = {}) ⇒ Object
374 375 376 377 378 379 380 381 |
# File 'lib/bio/io/hinv.rb', line 374 def query(hash = {}) default = { "start" => 1, "end" => 100 } = default.update(hash) super() end |
#result ⇒ Object
<HINVDB_SEARCH>
398 399 400 401 402 403 404 |
# 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 ⇒ Object
406 407 408 |
# File 'lib/bio/io/hinv.rb', line 406 def size @xml.elements['//SIZE'].text.to_i end |
#start ⇒ Object
409 410 411 |
# File 'lib/bio/io/hinv.rb', line 409 def start @xml.elements['//START'].text.to_i end |