Class: Bio::Hinv::Hix2hit

Inherits:
Object show all
Includes:
Common
Defined in:
lib/bio/io/hinv.rb

Overview

serv = Bio::Hinv::Hix2hit.new serv.query(“hix” => “HIX0000004”) puts serv.result

Instance Method Summary collapse

Methods included from Common

#query

Constructor Details

#initializeHix2hit

Returns a new instance of Hix2hit.



287
288
289
# File 'lib/bio/io/hinv.rb', line 287

def initialize
  @url = BASE_URI + "hix2hit.php"
end

Instance Method Details

#resultObject

<?xml version=‘1.0’ encoding=‘UTF-8’?> <H-Inv>

<H-INVITATIONAL-ID>HIT000012846</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022124</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000007722</H-INVITATIONAL-ID>
  :
<H-INVITATIONAL-ID>HIT000262478</H-INVITATIONAL-ID>

</H-Inv>



299
300
301
302
303
304
305
# File 'lib/bio/io/hinv.rb', line 299

def result
  list = []
  @xml.elements.each('//H-INVITATIONAL-ID') do |e|
    list << e.text
  end
  return list
end