Module: Jat::Plugins::JsonApiValidateParams

Defined in:
lib/jat/plugins/json_api/plugins/json_api_validate_params/json_api_validate_params.rb,
lib/jat/plugins/json_api/plugins/json_api_validate_params/lib/validate_fields_param.rb,
lib/jat/plugins/json_api/plugins/json_api_validate_params/lib/validate_include_param.rb

Defined Under Namespace

Modules: ClassMethods, FieldsParamParserClassMethods, IncludeParamParserClassMethods, InstanceMethods Classes: ValidateFieldsParam, ValidateIncludeParam

Class Method Summary collapse

Class Method Details

.before_load(jat_class, **_opts) ⇒ Object

Raises:



14
15
16
17
# File 'lib/jat/plugins/json_api/plugins/json_api_validate_params/json_api_validate_params.rb', line 14

def self.before_load(jat_class, **_opts)
  return if jat_class.plugin_used?(:json_api)
  raise Error, "Please load :json_api plugin first"
end

.load(jat_class, **_opts) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/jat/plugins/json_api/plugins/json_api_validate_params/json_api_validate_params.rb', line 19

def self.load(jat_class, **_opts)
  jat_class.extend(ClassMethods)
  jat_class.include(InstanceMethods)

  jat_class::FieldsParamParser.extend(FieldsParamParserClassMethods)
  jat_class::IncludeParamParser.extend(IncludeParamParserClassMethods)
end

.plugin_nameObject



10
11
12
# File 'lib/jat/plugins/json_api/plugins/json_api_validate_params/json_api_validate_params.rb', line 10

def self.plugin_name
  :json_api_validate_params
end