Sha256: dfc329b9bee2645ea55fcf6f18fe0a8d277909f5d25b6bd8d46d4b52a6e6a31e

Contents?: true

Size: 447 Bytes

Versions: 11

Compression:

Stored size: 447 Bytes

Contents

# frozen_string_literal: true

module OpenApi
  module Helpers
    def fusion
      proc { |a, b| a.deep_merge!(b) { |common_key, va, vb| common_key == :required ? va + vb : vb } }
    end

    def truly_present?(obj)
      obj == false || obj.present?
    end

    def value_present
      proc { |_, v| truly_present? v }
    end

    def reducing(*values)
      values.compact.reduce(processed, :merge!).keep_if &value_present
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
zero-rails_openapi-2.2.0 lib/oas_objs/helpers.rb
zero-rails_openapi-2.1.5 lib/oas_objs/helpers.rb
zero-rails_openapi-2.1.4 lib/oas_objs/helpers.rb
zero-rails_openapi-2.1.3 lib/oas_objs/helpers.rb
zero-rails_openapi-2.1.2 lib/oas_objs/helpers.rb
zero-rails_openapi-2.1.1 lib/oas_objs/helpers.rb
zero-rails_openapi-2.1.0 lib/oas_objs/helpers.rb
zero-rails_openapi-2.0.3 lib/oas_objs/helpers.rb
zero-rails_openapi-2.0.2 lib/oas_objs/helpers.rb
zero-rails_openapi-2.0.1 lib/oas_objs/helpers.rb
zero-rails_openapi-2.0.0 lib/oas_objs/helpers.rb