Module: JsonapiCompliable

Defined in:
lib/jsonapi_compliable/configuration.rb,
lib/jsonapi_compliable.rb,
lib/jsonapi_compliable/base.rb,
lib/jsonapi_compliable/query.rb,
lib/jsonapi_compliable/rails.rb,
lib/jsonapi_compliable/scope.rb,
lib/jsonapi_compliable/errors.rb,
lib/jsonapi_compliable/version.rb,
lib/jsonapi_compliable/resource.rb,
lib/jsonapi_compliable/sideload.rb,
lib/jsonapi_compliable/stats/dsl.rb,
lib/jsonapi_compliable/util/hash.rb,
lib/jsonapi_compliable/scoping/base.rb,
lib/jsonapi_compliable/scoping/sort.rb,
lib/jsonapi_compliable/adapters/null.rb,
lib/jsonapi_compliable/stats/payload.rb,
lib/jsonapi_compliable/util/sideload.rb,
lib/jsonapi_compliable/scoping/filter.rb,
lib/jsonapi_compliable/scoping/paginate.rb,
lib/jsonapi_compliable/adapters/abstract.rb,
lib/jsonapi_compliable/util/field_params.rb,
lib/jsonapi_compliable/extensions/temp_id.rb,
lib/jsonapi_compliable/scoping/filterable.rb,
lib/jsonapi_compliable/util/include_params.rb,
lib/jsonapi_compliable/util/render_options.rb,
lib/jsonapi_compliable/scoping/extra_fields.rb,
lib/jsonapi_compliable/adapters/active_record.rb,
lib/jsonapi_compliable/scoping/default_filter.rb,
lib/jsonapi_compliable/util/relationship_payload.rb,
lib/jsonapi_compliable/extensions/extra_attribute.rb,
lib/jsonapi_compliable/extensions/boolean_attribute.rb,
lib/jsonapi_compliable/adapters/active_record_sideloading.rb

Overview

Defined Under Namespace

Modules: Adapters, Base, Errors, Extensions, Rails, Scoping, SerializableTempId, Stats, Util Classes: Configuration, Deserializer, Query, Resource, Scope, Sideload

Constant Summary

VERSION =
"0.11.6"

Class Method Summary collapse

Class Method Details

.configObject



69
70
71
# File 'lib/jsonapi_compliable.rb', line 69

def self.config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Examples:

JsonapiCompliable.configure do |c|
  c.raise_on_missing_sideload = false
end

Yields:

See Also:



79
80
81
# File 'lib/jsonapi_compliable.rb', line 79

def self.configure
  yield config
end

.contextObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
# File 'lib/jsonapi_compliable.rb', line 49

def self.context
  Thread.current[:context] ||= {}
end

.context=(val) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



54
55
56
# File 'lib/jsonapi_compliable.rb', line 54

def self.context=(val)
  Thread.current[:context] = val
end

.included(klass) ⇒ Object



42
43
44
45
46
# File 'lib/jsonapi_compliable.rb', line 42

def self.included(klass)
  klass.instance_eval do
    include Base
  end
end

.with_context(obj, namespace) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



59
60
61
62
63
64
65
66
67
# File 'lib/jsonapi_compliable.rb', line 59

def self.with_context(obj, namespace)
  begin
    prior = self.context
    self.context = { object: obj, namespace: namespace }
    yield
  ensure
    self.context = prior
  end
end