Class: Chem::NCBI::EInfo::DbInfo
- Inherits:
-
Object
- Object
- Chem::NCBI::EInfo::DbInfo
- Defined in:
- lib/chem/utils/net.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#db_name ⇒ Object
readonly
Returns the value of attribute db_name.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#last_update ⇒ Object
readonly
Returns the value of attribute last_update.
-
#menu_name ⇒ Object
readonly
Returns the value of attribute menu_name.
Instance Method Summary collapse
-
#initialize(xml) ⇒ DbInfo
constructor
A new instance of DbInfo.
Constructor Details
#initialize(xml) ⇒ DbInfo
Returns a new instance of DbInfo.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/chem/utils/net.rb', line 55 def initialize(xml) @db_name = xml.elements["eInfoResult/DbInfo/DbName"].text @menu_name = xml.elements["eInfoResult/DbInfo/MenuName"].text @description = xml.elements["eInfoResult/DbInfo/Description"].text @count = xml.elements["eInfoResult/DbInfo/Count"].text @last_update = xml.elements["eInfoResult/DbInfo/LastUpdate"].text @fields = [] xml.elements.each("eInfoResult/DbInfo/FieldList/Field") do |element| @fields << { :name => element.elements["Name" ].text, :full_name => element.elements["FullName" ].text, :description => element.elements["Description"].text, :term_count => element.elements["TermCount" ].text, :is_date => element.elements["IsDate" ].text == "Y", :is_numerical => element.elements["IsNumerical"].text == "Y", :single_token => element.elements["SingleToken"].text == "Y", :hierarchy => element.elements["Hierarchy" ].text == "Y", :is_hidden => element.elements["IsHidden" ].text == "Y", } end end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
54 55 56 |
# File 'lib/chem/utils/net.rb', line 54 def count @count end |
#db_name ⇒ Object (readonly)
Returns the value of attribute db_name.
54 55 56 |
# File 'lib/chem/utils/net.rb', line 54 def db_name @db_name end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
54 55 56 |
# File 'lib/chem/utils/net.rb', line 54 def description @description end |
#last_update ⇒ Object (readonly)
Returns the value of attribute last_update.
54 55 56 |
# File 'lib/chem/utils/net.rb', line 54 def last_update @last_update end |
#menu_name ⇒ Object (readonly)
Returns the value of attribute menu_name.
54 55 56 |
# File 'lib/chem/utils/net.rb', line 54 def @menu_name end |