Sha256: 5c46a6d605448b133f73dab3e75b1701bc8e743f6c99892c08be37875e47e532

Contents?: true

Size: 509 Bytes

Versions: 6

Compression:

Stored size: 509 Bytes

Contents

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

  #
  # @api_param_data - RailsApiDoc::Controller::Ruquest::Param
  # @controller_param - ActionController::Parameter
  #
  # check validation of current type by given data
  #
  # enum: check that enum array includes given value
  #
  def valid?(controller_param, api_param_data)
    return true unless api_param_data.enum?

    api_param_data[:enum].include?(controller_param)
  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_enum.rb
rails_api_documentation-0.3.3 lib/rails_api_doc/config/validate_enum.rb
rails_api_documentation-0.3.2 lib/rails_api_doc/config/validate_enum.rb
rails_api_documentation-0.3.1 lib/rails_api_doc/config/validate_enum.rb
rails_api_documentation-0.3.0 lib/rails_api_doc/config/validate_enum.rb
rails_api_documentation-0.2.3 lib/rails_api_doc/config/validate_enum.rb