lib/rock_fintech/http/response.rb in rock_fintech-0.7.0 vs lib/rock_fintech/http/response.rb in rock_fintech-0.8.0
- old
+ new
@@ -9,18 +9,19 @@
def initialize(params)
self.data_valid = true
params.each do |key, value|
- instance_variable_set("@#{key}", value)
+ self.instance_variable_set("@#{key}", value)
end
self.data = {} if self.data.nil? # 默认一定要有
unless self.data_valid
self.data[:code] = 'sign_valid_fail'
self.data[:msg] = '数据签名错误'
end
+
end
def [] key
instance_variable_get("#{key}")
end