Module: WWW::Delicious::XMLUtils
- Included in:
- REXML::Element
- Defined in:
- lib/www/delicious.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#attribute_value(xmlattr, &block) ⇒ Object
Returns the
xmlattr
attribute value for givennode
.
Instance Method Details
#attribute_value(xmlattr, &block) ⇒ Object
Returns the xmlattr
attribute value for given node
.
If block is given and attrivute value is not nil the content of the block is executed.
Params
- node
-
The REXML::Element node context
- xmlattr
-
A String corresponding to the name of the XML attribute to search for
Return
The value of the xmlattr
if the attribute exists for given node
, nil
otherwise.
848 849 850 851 852 853 854 855 856 |
# File 'lib/www/delicious.rb', line 848 def attribute_value(xmlattr, &block) #:nodoc: value = if attr = self.attribute(xmlattr.to_s()) attr.value() else nil end value = yield value if !value.nil? and block_given? return value end |