Class: StoreModel::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/store_model/configuration.rb

Overview

StoreModel configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



27
28
29
30
31
# File 'lib/store_model/configuration.rb', line 27

def initialize
  @serialize_unknown_attributes = true
  @enable_parent_assignment = true
  @serialize_enums_using_as_json = true
end

Instance Attribute Details

#enable_parent_assignmentBoolean

Controls if parent tracking functionality is enabled. Default: true

Returns:

  • (Boolean)


25
26
27
# File 'lib/store_model/configuration.rb', line 25

def enable_parent_assignment
  @enable_parent_assignment
end

#merge_array_errorsBoolean

Controls usage of MergeArrayErrorStrategy

Returns:

  • (Boolean)


12
13
14
# File 'lib/store_model/configuration.rb', line 12

def merge_array_errors
  @merge_array_errors
end

#merge_errorsBoolean

Controls usage of MergeErrorStrategy

Returns:

  • (Boolean)


8
9
10
# File 'lib/store_model/configuration.rb', line 8

def merge_errors
  @merge_errors
end

#serialize_enums_using_as_jsonBoolean

Controls if the result of ‘as_json` will serialize enum fields using `as_json`

Returns:

  • (Boolean)


20
21
22
# File 'lib/store_model/configuration.rb', line 20

def serialize_enums_using_as_json
  @serialize_enums_using_as_json
end

#serialize_unknown_attributesBoolean

Controls if the result of ‘as_json` will contain the unknown attributes of the model

Returns:

  • (Boolean)


16
17
18
# File 'lib/store_model/configuration.rb', line 16

def serialize_unknown_attributes
  @serialize_unknown_attributes
end