lib/textmagic/error.rb in textmagic-0.6.0 vs lib/textmagic/error.rb in textmagic-0.7.0
- old
+ new
@@ -11,17 +11,21 @@
#
# TextMagic::API::Error.new(code, message)
# TextMagic::API::Error.new("error_code" => code, "error_message" => message)
def initialize(*args)
if args.first.is_a?(Hash)
- @code, @message = args.first["error_code"], args.first["error_message"]
+ @code = args.first["error_code"]
+ @message = args.first["error_message"]
else
@code, @message = args
end
end
def to_s
"#{@message} (#{@code})"
end
+
end
+
end
+
end