Sha256: 039a560016889ee19b04750ccde32bc6addb80180c63f5fab99cdd4b3da9b50a

Contents?: true

Size: 599 Bytes

Versions: 6

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true
# author: Vadim Shaveiko <@vshaveyko>
class RailsApiDoc::Config::ValidateAryObject

  #
  # @api_param_data - RailsApiDoc::Controller::Request::Param
  # @controller_param - ActionController::Parameter
  #
  # check validation of current type by given data
  #
  # ary_object: check that parameter is array of parameters
  #
  def valid?(controller_param, api_param_data)
    return true unless api_param_data.ary_object?

    controller_param.is_a?(Array) && begin
      controller_param.all? { |param| param.is_a?(::ActionController::Parameters) }
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_api_documentation-0.3.4 lib/rails_api_doc/config/validate_ary_object.rb
rails_api_documentation-0.3.3 lib/rails_api_doc/config/validate_ary_object.rb
rails_api_documentation-0.3.2 lib/rails_api_doc/config/validate_ary_object.rb
rails_api_documentation-0.3.1 lib/rails_api_doc/config/validate_ary_object.rb
rails_api_documentation-0.3.0 lib/rails_api_doc/config/validate_ary_object.rb
rails_api_documentation-0.2.3 lib/rails_api_doc/config/validate_ary_object.rb