Class: JSONAPI::Configuration
- Inherits:
-
Object
- Object
- JSONAPI::Configuration
- Defined in:
- lib/json_api/configuration.rb
Instance Attribute Summary collapse
-
#authorization_handler ⇒ Object
Returns the value of attribute authorization_handler.
-
#authorization_scope ⇒ Object
Returns the value of attribute authorization_scope.
-
#correlation_id_resolver ⇒ Object
Returns the value of attribute correlation_id_resolver.
-
#default_page_size ⇒ Object
Returns the value of attribute default_page_size.
-
#document_meta_resolver ⇒ Object
Returns the value of attribute document_meta_resolver.
-
#jpie_headers_enabled ⇒ Object
Returns the value of attribute jpie_headers_enabled.
-
#jsonapi_meta ⇒ Object
Returns the value of attribute jsonapi_meta.
-
#max_page_size ⇒ Object
Returns the value of attribute max_page_size.
-
#n1_detection_enabled ⇒ Object
Returns the value of attribute n1_detection_enabled.
-
#namespace_fallback ⇒ Object
Returns the value of attribute namespace_fallback.
-
#namespace_model_mapping ⇒ Object
Returns the value of attribute namespace_model_mapping.
-
#namespace_type_format ⇒ Object
Returns the value of attribute namespace_type_format.
-
#query_count_threshold ⇒ Object
Returns the value of attribute query_count_threshold.
-
#query_tracking_enabled ⇒ Object
Returns the value of attribute query_tracking_enabled.
-
#query_tracking_queries_cap ⇒ Object
Returns the value of attribute query_tracking_queries_cap.
-
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
-
#variant_failure_fallback ⇒ Object
Returns the value of attribute variant_failure_fallback.
Instance Method Summary collapse
- #base_controller_class ⇒ Object
- #base_controller_class=(value) ⇒ Object
- #base_controller_overridden? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #resolved_base_controller_class ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 |
# File 'lib/json_api/configuration.rb', line 15 def initialize set_defaults end |
Instance Attribute Details
#authorization_handler ⇒ Object
Returns the value of attribute authorization_handler.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def end |
#authorization_scope ⇒ Object
Returns the value of attribute authorization_scope.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def end |
#correlation_id_resolver ⇒ Object
Returns the value of attribute correlation_id_resolver.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def correlation_id_resolver @correlation_id_resolver end |
#default_page_size ⇒ Object
Returns the value of attribute default_page_size.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def default_page_size @default_page_size end |
#document_meta_resolver ⇒ Object
Returns the value of attribute document_meta_resolver.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def end |
#jpie_headers_enabled ⇒ Object
Returns the value of attribute jpie_headers_enabled.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def jpie_headers_enabled @jpie_headers_enabled end |
#jsonapi_meta ⇒ Object
Returns the value of attribute jsonapi_meta.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def end |
#max_page_size ⇒ Object
Returns the value of attribute max_page_size.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def max_page_size @max_page_size end |
#n1_detection_enabled ⇒ Object
Returns the value of attribute n1_detection_enabled.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def n1_detection_enabled @n1_detection_enabled end |
#namespace_fallback ⇒ Object
Returns the value of attribute namespace_fallback.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def namespace_fallback @namespace_fallback end |
#namespace_model_mapping ⇒ Object
Returns the value of attribute namespace_model_mapping.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def namespace_model_mapping @namespace_model_mapping end |
#namespace_type_format ⇒ Object
Returns the value of attribute namespace_type_format.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def namespace_type_format @namespace_type_format end |
#query_count_threshold ⇒ Object
Returns the value of attribute query_count_threshold.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def query_count_threshold @query_count_threshold end |
#query_tracking_enabled ⇒ Object
Returns the value of attribute query_tracking_enabled.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def query_tracking_enabled @query_tracking_enabled end |
#query_tracking_queries_cap ⇒ Object
Returns the value of attribute query_tracking_queries_cap.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def query_tracking_queries_cap @query_tracking_queries_cap end |
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def slow_query_threshold_ms @slow_query_threshold_ms end |
#variant_failure_fallback ⇒ Object
Returns the value of attribute variant_failure_fallback.
5 6 7 |
# File 'lib/json_api/configuration.rb', line 5 def variant_failure_fallback @variant_failure_fallback end |
Instance Method Details
#base_controller_class ⇒ Object
35 36 37 |
# File 'lib/json_api/configuration.rb', line 35 def base_controller_class @base_controller_class.constantize end |
#base_controller_class=(value) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/json_api/configuration.rb', line 19 def base_controller_class=(value) if value.is_a?(Class) @base_controller_class = value.name elsif value.is_a?(String) raise ArgumentError, "base_controller_class cannot be blank" if value.nil? || value.strip.empty? @base_controller_class = value else raise ArgumentError, "base_controller_class must be a string or class" end return unless Rails.application&.initialized? JSONAPI.rebuild_base_controllers! end |
#base_controller_overridden? ⇒ Boolean
46 47 48 |
# File 'lib/json_api/configuration.rb', line 46 def base_controller_overridden? @base_controller_class != "ActionController::API" end |
#resolved_base_controller_class ⇒ Object
39 40 41 42 43 44 |
# File 'lib/json_api/configuration.rb', line 39 def resolved_base_controller_class class_name = @base_controller_class raise ArgumentError, "base_controller_class cannot be blank" if class_name.nil? || class_name.empty? class_name.constantize end |