Class: JSONAPI::Configuration
- Inherits:
-
Object
- Object
- JSONAPI::Configuration
- Defined in:
- lib/jsonapi/configuration.rb
Instance Attribute Summary collapse
-
#allowed_request_params ⇒ Object
Returns the value of attribute allowed_request_params.
-
#default_page_size ⇒ Object
Returns the value of attribute default_page_size.
-
#default_paginator ⇒ Object
Returns the value of attribute default_paginator.
-
#json_key_format ⇒ Object
Returns the value of attribute json_key_format.
-
#key_formatter ⇒ Object
readonly
Returns the value of attribute key_formatter.
-
#maximum_page_size ⇒ Object
Returns the value of attribute maximum_page_size.
-
#operations_processor ⇒ Object
Returns the value of attribute operations_processor.
-
#route_format ⇒ Object
Returns the value of attribute route_format.
-
#route_formatter ⇒ Object
readonly
Returns the value of attribute route_formatter.
-
#top_level_links_include_pagination ⇒ Object
Returns the value of attribute top_level_links_include_pagination.
-
#top_level_meta_include_record_count ⇒ Object
Returns the value of attribute top_level_meta_include_record_count.
-
#top_level_meta_record_count_key ⇒ Object
Returns the value of attribute top_level_meta_record_count_key.
-
#use_text_errors ⇒ Object
Returns the value of attribute use_text_errors.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/jsonapi/configuration.rb', line 21 def initialize #:underscored_key, :camelized_key, :dasherized_key, or custom self.json_key_format = :dasherized_key #:underscored_route, :camelized_route, :dasherized_route, or custom self.route_format = :dasherized_route #:basic, :active_record, or custom self.operations_processor = :active_record self.allowed_request_params = [:include, :fields, :format, :controller, :action, :sort, :page] # :none, :offset, :paged, or a custom paginator name self.default_paginator = :none # Output pagination links at top level self.top_level_links_include_pagination = true self.default_page_size = 10 self.maximum_page_size = 20 # Metadata # Output record count in top level meta for find operation self. = false self. = :record_count self.use_text_errors = false end |
Instance Attribute Details
#allowed_request_params ⇒ Object
Returns the value of attribute allowed_request_params.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def allowed_request_params @allowed_request_params end |
#default_page_size ⇒ Object
Returns the value of attribute default_page_size.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def default_page_size @default_page_size end |
#default_paginator ⇒ Object
Returns the value of attribute default_paginator.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def default_paginator @default_paginator end |
#json_key_format ⇒ Object
Returns the value of attribute json_key_format.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def json_key_format @json_key_format end |
#key_formatter ⇒ Object (readonly)
Returns the value of attribute key_formatter.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def key_formatter @key_formatter end |
#maximum_page_size ⇒ Object
Returns the value of attribute maximum_page_size.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def maximum_page_size @maximum_page_size end |
#operations_processor ⇒ Object
Returns the value of attribute operations_processor.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def operations_processor @operations_processor end |
#route_format ⇒ Object
Returns the value of attribute route_format.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def route_format @route_format end |
#route_formatter ⇒ Object (readonly)
Returns the value of attribute route_formatter.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def route_formatter @route_formatter end |
#top_level_links_include_pagination ⇒ Object
Returns the value of attribute top_level_links_include_pagination.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def top_level_links_include_pagination @top_level_links_include_pagination end |
#top_level_meta_include_record_count ⇒ Object
Returns the value of attribute top_level_meta_include_record_count.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def @top_level_meta_include_record_count end |
#top_level_meta_record_count_key ⇒ Object
Returns the value of attribute top_level_meta_record_count_key.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def @top_level_meta_record_count_key end |
#use_text_errors ⇒ Object
Returns the value of attribute use_text_errors.
7 8 9 |
# File 'lib/jsonapi/configuration.rb', line 7 def use_text_errors @use_text_errors end |