lib/csl/locale/term.rb in csl-1.0.0.pre21 vs lib/csl/locale/term.rb in csl-1.0.0.pre22
- old
+ new
@@ -211,18 +211,25 @@
class << self
attr_reader :form_fallbacks
def specialize(options)
- options = options.select do |k,v|
- !v.nil? && Term::Attributes.keys.include?(k.to_sym)
+ specialized = {}
+
+ options.each do |key, value|
+ key = key.to_sym
+
+ if !value.nil? && Term::Attributes.keys.include?(key)
+ specialized[key] = value
+ end
end
- options.delete :'gender-form' unless
- options[:'gender-form'].to_s =~ /^masculine|feminine$/
+ specialized.delete :'gender-form' unless
+ specialized[:'gender-form'].to_s =~ /^masculine|feminine$/
- options
+ specialized
end
+
end
# This method returns whether or not the ordinal term matchs the
# passed-in modulus. This is determined by the ordinal term's match
# attribute: a value of 'last-two-digits' matches a modulus of 100,
\ No newline at end of file