Class: Scopus::XMLResponse::XMLResponseGeneric

Inherits:
Object
  • Object
show all
Defined in:
lib/scopus/xml_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ XMLResponseGeneric

Returns a new instance of XMLResponseGeneric.



40
41
42
43
# File 'lib/scopus/xml_response.rb', line 40

def initialize(xml)
  @xml=xml
  process()
end

Instance Attribute Details

#xmlObject (readonly)

Returns the value of attribute xml.



39
40
41
# File 'lib/scopus/xml_response.rb', line 39

def xml
  @xml
end

Instance Method Details

#processObject

Just put anything you want here



45
46
# File 'lib/scopus/xml_response.rb', line 45

def process
end

#process_path(x, path) ⇒ Object



47
48
49
50
# File 'lib/scopus/xml_response.rb', line 47

def process_path(x, path)
  node=x.at_xpath(path)
  (node.nil?) ? nil : node.text
end