Module: ActsAsApi::Config

Defined in:
lib/acts_as_api/config.rb

Class Attribute Summary (collapse)

Class Attribute Details

+ (Object) accepted_api_formats

The accepted response formats Default is [:xml, :json]



11
12
13
# File 'lib/acts_as_api/config.rb', line 11

def accepted_api_formats
  @accepted_api_formats || [:xml, :json]
end

+ (Object) add_http_status_to_jsonp_response

If true the jsonp function call will get the http status passed as a second parameter



51
52
53
# File 'lib/acts_as_api/config.rb', line 51

def add_http_status_to_jsonp_response
  @add_http_status_to_jsonp_response.nil? ? true : @add_http_status_to_jsonp_response
end

+ (Object) add_root_node_for

Holds references to formats that need to get added an additional root node with the name of the model.



31
32
33
# File 'lib/acts_as_api/config.rb', line 31

def add_root_node_for
  @add_root_node_for || [:json]
end

+ (Object) allow_jsonp_callback

If true a json response will be automatically wrapped into a JavaScript function call in case a :callback param is passed.



45
46
47
# File 'lib/acts_as_api/config.rb', line 45

def allow_jsonp_callback
  @allow_jsonp_callback || false
end

+ (Object) dasherize_for

Holds formats that should be dasherized Default is [:xml]



17
18
19
# File 'lib/acts_as_api/config.rb', line 17

def dasherize_for
  @dasherize_for || [:xml]
end

+ (Object) default_root

The default name of a root node of a response if no root paramter is passed in render_for_api and the gem is not able to determine a root name automatically



39
40
41
# File 'lib/acts_as_api/config.rb', line 39

def default_root
  @default_root || :record
end

+ (Object) include_root_in_json_collections

If true, the root node in json collections will be added so the response will look like the default Rails 3 json response



24
25
26
# File 'lib/acts_as_api/config.rb', line 24

def include_root_in_json_collections
  @include_root_in_json_collections || false
end