Class: Mabmapper::MabXml::Query
- Inherits:
-
Object
- Object
- Mabmapper::MabXml::Query
- Includes:
- QueryHelper
- Defined in:
- lib/mabmapper/mab_xml/query.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#subfields ⇒ Object
readonly
Returns the value of attribute subfields.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
- #add_field(name, options = {}) ⇒ Object
- #add_subfield(name) ⇒ Object
-
#initialize(xml) ⇒ Query
constructor
A new instance of Query.
Methods included from QueryHelper
Constructor Details
#initialize(xml) ⇒ Query
Returns a new instance of Query.
8 9 10 11 12 |
# File 'lib/mabmapper/mab_xml/query.rb', line 8 def initialize(xml) @xml = xml @fields = [] @subfields = [] end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
6 7 8 |
# File 'lib/mabmapper/mab_xml/query.rb', line 6 def fields @fields end |
#subfields ⇒ Object (readonly)
Returns the value of attribute subfields.
6 7 8 |
# File 'lib/mabmapper/mab_xml/query.rb', line 6 def subfields @subfields end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
6 7 8 |
# File 'lib/mabmapper/mab_xml/query.rb', line 6 def xml @xml end |
Instance Method Details
#add_field(name, options = {}) ⇒ Object
14 15 16 17 |
# File 'lib/mabmapper/mab_xml/query.rb', line 14 def add_field(name, ={}) @fields << {name: name, options: .reverse_merge(ind1: nil, ind2: nil)} self end |
#add_subfield(name) ⇒ Object
19 20 21 22 |
# File 'lib/mabmapper/mab_xml/query.rb', line 19 def add_subfield(name) @subfields << {name: name} self end |