Returns the node’s attributes matching the filter.
Parameters:
a customizable set of options
Options Hash (*filter):
list of attribute names
Returns:
the node’s attributes matching the filter
427 428 429 430 431 432 433
# File 'lib/csl/node.rb', line 427 def attributes_for(*filter) filter.flatten! Hash[map { |name, value| !value.nil? && filter.include?(name) ? [name, value.to_s] : nil }.compact] end