Class: Nokogiri::XML::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/deltacloud_vm/core_ext/element.rb

Instance Method Summary collapse

Instance Method Details

#attr_at(xpath, attr_name) ⇒ Object



25
26
27
# File 'lib/deltacloud_vm/core_ext/element.rb', line 25

def attr_at(xpath, attr_name)
  (val = self.at(xpath)) ? val[attr_name.to_s.strip] : nil
end

#text_at(xpath) ⇒ Object



21
22
23
# File 'lib/deltacloud_vm/core_ext/element.rb', line 21

def text_at(xpath)
  (val = self.at(xpath)) ? val.text.strip : nil
end