Class: Wallaby::FieldsRegulator

Inherits:
Struct
  • Object
show all
Defined in:
lib/services/wallaby/fields_regulator.rb

Overview

Validate and convert the field metadata to ‘ActiveSupport::HashWithIndifferentAccess`

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields

Returns:

  • (Object)

    the current value of fields



5
6
7
# File 'lib/services/wallaby/fields_regulator.rb', line 5

def fields
  @fields
end

Instance Method Details

#executeActiveSupport::HashWithIndifferentAccess

Returns:

  • (ActiveSupport::HashWithIndifferentAccess)


7
8
9
10
11
# File 'lib/services/wallaby/fields_regulator.rb', line 7

def execute
  ensure_fields_is_a_hash
  ensure_type_is_present
  normalized_fields
end