Class: ApipieDSL::Validator::KWRestValidator

Inherits:
BaseValidator show all
Defined in:
lib/apipie_dsl/validator.rb

Instance Attribute Summary

Attributes inherited from BaseValidator

#param_description

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseValidator

#==, #docs, find, inherited, #initialize, #inspect, #inspected_fields, #merge_with, #sub_params, #to_s, #valid?

Constructor Details

This class inherits a constructor from ApipieDSL::Validator::BaseValidator

Class Method Details

.build(param_description, argument, _options, _block) ⇒ Object



444
445
446
447
448
# File 'lib/apipie_dsl/validator.rb', line 444

def self.build(param_description, argument, _options, _block)
  return unless %i[kwrest kwlist kwsplat].include?(argument)

  new(param_description)
end

Instance Method Details

#descriptionObject



455
456
457
# File 'lib/apipie_dsl/validator.rb', line 455

def description
  'Must be a list of key: value'
end

#expected_typeObject



459
460
461
# File 'lib/apipie_dsl/validator.rb', line 459

def expected_type
  'kwlist'
end

#validate(_value) ⇒ Object



450
451
452
453
# File 'lib/apipie_dsl/validator.rb', line 450

def validate(_value)
  # In **kwrest param we don't care about passed values.
  true
end