lib/faastruby/base.rb in faastruby-0.5.25 vs lib/faastruby/base.rb in faastruby-0.5.26
- old
+ new
@@ -52,9 +52,17 @@
def attributes=(params)
assign_attributes(params)
end
+ def call_api
+ response = yield
+ @status_code = response.code
+ @errors += response.errors if response.errors.any?
+
+ response
+ end
+
def mass_assign(attrs)
attrs.each do |key, value|
self.public_send("#{key}=", value)
end
end