lib/buckaruby/response.rb in buckaruby-1.1.1 vs lib/buckaruby/response.rb in buckaruby-1.2.0
- old
+ new
@@ -37,9 +37,39 @@
def timestamp
parse_time(params[:brq_timestamp])
end
+ def custom
+ @custom ||= begin
+ custom = Support::CaseInsensitiveHash.new
+
+ params.each do |key, value|
+ next unless key.upcase.start_with?("CUST_")
+
+ new_key = key.to_s[5..-1]
+ custom[new_key] = value
+ end
+
+ custom
+ end
+ end
+
+ def additional
+ @additional ||= begin
+ additional = Support::CaseInsensitiveHash.new
+
+ params.each do |key, value|
+ next unless key.upcase.start_with?("ADD_")
+
+ new_key = key.to_s[4..-1]
+ additional[new_key] = value
+ end
+
+ additional
+ end
+ end
+
private
def parse_response(body)
if body.is_a?(Hash)
response = body