Skip to content

Commit

Permalink
Remove Array#to_h to support old rubies
Browse files Browse the repository at this point in the history
  • Loading branch information
sonots committed Apr 27, 2015
1 parent 5b5942a commit 9625427
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/fluent/plugin/filter_typecast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ class TypecastFilter < Filter
include ::Fluent::TextParser::TypeConverter

def filter(tag, time, record)
record.map do |key, val|
filtered = record.map do |key, val|
[key, convert_type(key, val)]
end.to_h
end
Hash[*filtered.flatten(1)]
end
end
end

0 comments on commit 9625427

Please sign in to comment.