lib/itsf/services/v2/service/base.rb in itsf_services-0.0.2 vs lib/itsf/services/v2/service/base.rb in itsf_services-0.0.3

- old
+ new

@@ -61,9 +61,21 @@ def response set_errors_on_response @response end + def say(message, options = {}) + options.reverse_merge!(indent: 0) + indent = options.delete(:indent) + puts "[#{self.class.name}]: #{' ' * indent}#{message}" + true + end + + def add_error_and_say(attribute, message, options = {}) + errors.add(attribute, message) + say(message, options) + end + def set_errors_on_response @response.send(:'errors=', @errors) end end end