lib/csl/style/choose.rb in csl-1.0.0.pre23 vs lib/csl/style/choose.rb in csl-1.0.0
- old
+ new
@@ -19,11 +19,11 @@
extract_type_and_matcher_from(name) << values.to_s.split(/\s+/)
end
end
def matcher(match = attributes[:match])
- case match
+ case match.to_s
when 'any'
:any?
when 'none'
:none?
else
@@ -35,11 +35,12 @@
def extract_type_and_matcher_from(attribute)
type, match = attribute.to_s.split(/-(any|all|none)$/, 2)
# subtle: if the default matcher is :none? and there
- # is no override we to use :any? in the nested lists
- # to avoid double negation during evaluation
+ # is no override we want to use :any? inside the nested
+ # lists to avoid double negation during evaluation of
+ # the entire expression!
if match.nil?
match = matcher
[type.to_sym, match == :none? ? :any? : matcher]
else
\ No newline at end of file