module HttpApiTools
Provides an expanded version of includes for use in queries where ids for has_many relationships are going to be referenced such as with the json serializer. Eradicates n+1 issues in these instances.
type/id map for mapping string or symbol keys and ids to objects.
Adds methods http_api_tools help a client to behave as if it's dealing with an ActiveModel object. Principle of least surprise here - if someone is working in Rails and using a model it should feel normal and they should be able to do all the things the'd do with an active model object except interact with the database.
Mix in to PORO to get basic attribute definition with type coercion and defaults. class MyClass
attribute :name attribute :date, type: :date_time attribute :tags, default: []
NOTE: Be careful of adding default values other than primitives, arrays or basic hashes. Anything more Complex will need to be copied into each object rather than by direct reference - see the way arrays and hashes are handled in the 'default_for' method below.
Hopefully the spec is robust enough http_api_tools we can break this down and refactor as we go. I'm not happy with the complexity of it, but it's a reasonably complex problem ~ Stu
Holds a fast access map of all sideloaded json for deserialization
Provides a cache for resolved type keys against classes. When serializing a lot of relationships this can have a significant improvement on performance.
Constants
- VERSION