lib/oas_objs/helpers.rb in zero-rails_openapi-1.3.3 vs lib/oas_objs/helpers.rb in zero-rails_openapi-1.4.0
- old
+ new
@@ -1,8 +1,7 @@
module OpenApi
module Helpers
-
# TODO: comment-block doc
def truly_present?(obj)
obj == false || obj.present?
end
@@ -21,14 +20,16 @@
@assign = values.compact.reduce({ }, :merge).keep_if &value_present
self
end
def to_processed(who)
+ return processed unless truly_present?(@assign)
+
if who.is_a?(Symbol)
send("#{who}=", @assign)
else
processed[who.to_sym] = @assign
- end if truly_present?(@assign)
+ end
processed
end
def to(who)