Class: Montague::XMLExtractor::Header
- Defined in:
- lib/montague/xml_extractor/header.rb
Overview
Header extractor
Instance Method Summary collapse
- #api_control ⇒ String?
- #hits ⇒ Fixnum?
-
#initialize(xml) ⇒ Header
constructor
A new instance of Header.
- #message ⇒ String?
- #model ⇒ Montague::Model::Header
- #outcome ⇒ String?
Constructor Details
#initialize(xml) ⇒ Header
Returns a new instance of Header.
7 8 9 |
# File 'lib/montague/xml_extractor/header.rb', line 7 def initialize(xml) super end |
Instance Method Details
#api_control ⇒ String?
12 13 14 |
# File 'lib/montague/xml_extractor/header.rb', line 12 def api_control xpath_query_for_single_value(File.join header_path, 'apicontrol') end |
#hits ⇒ Fixnum?
17 18 19 |
# File 'lib/montague/xml_extractor/header.rb', line 17 def hits xpath_query_for_single_value(File.join header_path, 'numhits').to_i end |
#message ⇒ String?
22 23 24 |
# File 'lib/montague/xml_extractor/header.rb', line 22 def xpath_query_for_single_value(File.join header_path, 'message') end |
#model ⇒ Montague::Model::Header
32 33 34 35 36 37 38 39 |
# File 'lib/montague/xml_extractor/header.rb', line 32 def model m = Montague::Model::Header.new m.api_control = api_control m.hits = hits m. = m.outcome = outcome m end |
#outcome ⇒ String?
27 28 29 |
# File 'lib/montague/xml_extractor/header.rb', line 27 def outcome xpath_query_for_single_value(File.join header_path, 'outcome') end |