Class: Jat::Plugins::JsonApi::Params::Fields::Validate
- Inherits:
-
Object
- Object
- Jat::Plugins::JsonApi::Params::Fields::Validate
- Defined in:
- lib/jat/plugins/json_api/lib/params/fields/validate.rb
Instance Attribute Summary collapse
-
#full_map ⇒ Object
readonly
Returns the value of attribute full_map.
-
#jat ⇒ Object
readonly
Returns the value of attribute jat.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(jat, type, full_map) ⇒ Validate
constructor
A new instance of Validate.
- #validate(attributes_names) ⇒ Object
Constructor Details
#initialize(jat, type, full_map) ⇒ Validate
Returns a new instance of Validate.
21 22 23 24 25 |
# File 'lib/jat/plugins/json_api/lib/params/fields/validate.rb', line 21 def initialize(jat, type, full_map) @jat = jat @type = type @full_map = full_map end |
Instance Attribute Details
#full_map ⇒ Object (readonly)
Returns the value of attribute full_map.
19 20 21 |
# File 'lib/jat/plugins/json_api/lib/params/fields/validate.rb', line 19 def full_map @full_map end |
#jat ⇒ Object (readonly)
Returns the value of attribute jat.
19 20 21 |
# File 'lib/jat/plugins/json_api/lib/params/fields/validate.rb', line 19 def jat @jat end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
19 20 21 |
# File 'lib/jat/plugins/json_api/lib/params/fields/validate.rb', line 19 def type @type end |
Class Method Details
.call(jat, fields) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/jat/plugins/json_api/lib/params/fields/validate.rb', line 10 def call(jat, fields) full_map = jat.maps.full fields.each do |type, attributes_names| new(jat, type, full_map).validate(attributes_names) end end |
Instance Method Details
#validate(attributes_names) ⇒ Object
27 28 29 30 |
# File 'lib/jat/plugins/json_api/lib/params/fields/validate.rb', line 27 def validate(attributes_names) check_fields_type check_attributes_names(attributes_names) end |