lib/io_streams/tabular/parser/hash.rb in iostreams-0.20.3 vs lib/io_streams/tabular/parser/hash.rb in iostreams-1.0.0.beta
- old
+ new
@@ -2,10 +2,13 @@
module IOStreams
class Tabular
module Parser
class Hash < Base
def parse(row)
- raise(IOStreams::Errors::TypeMismatch, "Format is :hash. Invalid input: #{row.class.name}") unless row.is_a?(::Hash)
+ unless row.is_a?(::Hash)
+ raise(IOStreams::Errors::TypeMismatch, "Format is :hash. Invalid input: #{row.class.name}")
+ end
+
row
end
def render(row, header)
header.to_hash(row)