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.
-
#route_format ⇒ Object
Returns the value of attribute route_format.
-
#route_formatter ⇒ Object
readonly
Returns the value of attribute route_formatter.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jsonapi/configuration.rb', line 14 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 self.allowed_request_params = [:include, :fields, :format, :controller, :action, :sort, :page] # :none, :offset, :paged, or a custom paginator name self.default_paginator = :none self.default_page_size = 10 self.maximum_page_size = 20 end |
Instance Attribute Details
#allowed_request_params ⇒ Object
Returns the value of attribute allowed_request_params.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def allowed_request_params @allowed_request_params end |
#default_page_size ⇒ Object
Returns the value of attribute default_page_size.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def default_page_size @default_page_size end |
#default_paginator ⇒ Object
Returns the value of attribute default_paginator.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def default_paginator @default_paginator end |
#json_key_format ⇒ Object
Returns the value of attribute json_key_format.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def json_key_format @json_key_format end |
#key_formatter ⇒ Object (readonly)
Returns the value of attribute key_formatter.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def key_formatter @key_formatter end |
#maximum_page_size ⇒ Object
Returns the value of attribute maximum_page_size.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def maximum_page_size @maximum_page_size end |
#route_format ⇒ Object
Returns the value of attribute route_format.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def route_format @route_format end |
#route_formatter ⇒ Object (readonly)
Returns the value of attribute route_formatter.
5 6 7 |
# File 'lib/jsonapi/configuration.rb', line 5 def route_formatter @route_formatter end |