Module: JSONAPI::RSpec
- Includes:
- Attributes, Id, JsonapiObject, Links, Meta, Relationships, Type
- Defined in:
- lib/jsonapi/rspec.rb,
lib/jsonapi/rspec/id.rb,
lib/jsonapi/rspec/meta.rb,
lib/jsonapi/rspec/type.rb,
lib/jsonapi/rspec/links.rb,
lib/jsonapi/rspec/errors.rb,
lib/jsonapi/rspec/attributes.rb,
lib/jsonapi/rspec/relationships.rb,
lib/jsonapi/rspec/jsonapi_object.rb
Defined Under Namespace
Modules: Attributes, Id, JsonapiObject, Links, Meta, Relationships, Type
Class Method Summary collapse
Class Method Details
.as_indifferent_hash(doc) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/jsonapi/rspec.rb', line 27 def self.as_indifferent_hash(doc) return doc unless ::RSpec.configuration.jsonapi_indifferent_hash if doc.respond_to?(:with_indifferent_access) return doc.with_indifferent_access end JSON.parse(JSON.generate(doc)) end |