# File lib/ruote/exp/ro_attributes.rb, line 75 def att (key, values, opts={}) default = opts[:default] || values.first val = attribute(key) val = val.to_s if val #raise( # ArgumentError.new("attribute '#{key}' missing in #{tree}") #) if opts[:mandatory] && val == nil #raise( # ArgumentError.new("attribute '#{key}' has invalid value in #{tree}") #) if opts[:enforce] && (not values.include?(val)) values.include?(val) ? val : default end