lib/oas_objs/helpers.rb in zero-rails_openapi-1.1.1 vs lib/oas_objs/helpers.rb in zero-rails_openapi-1.2.0
- old
+ new
@@ -5,26 +5,26 @@
def truly_present?(obj)
obj == false || obj.present?
end
def value_present
- Proc.new { |_, v| truly_present? v }
+ proc { |_, v| truly_present? v }
end
def assign(value)
- @assign = value.is_a?(Symbol)? self.send("_#{value}") : value
+ @assign = value.is_a?(Symbol) ? send("_#{value}") : value
self
end
- def all(*values)
+ def reduceee(*values)
@assign = values.compact.reduce({ }, :merge).keep_if &value_present
self
end
def to_processed(who)
if who.is_a?(Symbol)
- self.send("#{who}=", @assign)
+ send("#{who}=", @assign)
else
processed[who.to_sym] = @assign
end if truly_present?(@assign)
processed
@@ -32,10 +32,10 @@
def to(who)
self[who.to_sym] = @assign if truly_present?(@assign)
end
- def for_merge # to_processed
+ def then_merge! # to_processed
processed.tap { |it| it.merge! @assign if truly_present?(@assign) }
end
end
end