Class: JSONAPI::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_paramsObject

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_sizeObject

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_paginatorObject

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_formatObject

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_formatterObject (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_sizeObject

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_formatObject

Returns the value of attribute route_format.



5
6
7
# File 'lib/jsonapi/configuration.rb', line 5

def route_format
  @route_format
end

#route_formatterObject (readonly)

Returns the value of attribute route_formatter.



5
6
7
# File 'lib/jsonapi/configuration.rb', line 5

def route_formatter
  @route_formatter
end