lib/citeproc/attributes.rb in citeproc-1.0.0.pre4 vs lib/citeproc/attributes.rb in citeproc-1.0.0.pre5
- old
+ new
@@ -19,11 +19,11 @@
attributes[filter_key(key)]
end
alias [] read_attribute
def write_attribute(key, value)
- attributes[filter_key(key)] = filter_value(value)
+ attributes[filter_key(key)] = filter_value(value, key)
end
alias []= write_attribute
def attribute?(key)
value = read_attribute key
@@ -135,17 +135,17 @@
new.merge(parameters)
end
def attr_predicates(*arguments)
arguments.flatten.each do |field|
- field, default = *(field.is_a?(Hash) ? field.to_a.flatten : [field]).map(&:to_s)
+ field, default = *(field.is_a?(Hash) ? field.to_a.flatten : [field])
attr_field(field, default, true)
end
end
def attr_fields(*arguments)
arguments.flatten.each do |field|
- attr_field(*(field.is_a?(Hash) ? field.to_a.flatten : [field]).map(&:to_s))
+ attr_field(*(field.is_a?(Hash) ? field.to_a.flatten : [field]))
end
end
def attr_field(field, default = nil, predicate = false)
method_id = field.to_s.downcase.gsub(/[-\s]+/, '_')
\ No newline at end of file