Adds serialization support through the following methods:
to_h: Serialize into a Ruby hash (with symbol keys). Accepts a boolean argument, representing whether or not to deep-serialize nested Author and Category objects (defaults to false).
as_json: Serialize into a Ruby hash which is also a valid JSON hash.
to_json: Serialize into a valid JSON string.
Adds ATTRIBUTES constant for Paper, Author and Category entities, as a list of which attributes are available for the entity.
to_h
: Serialize into a Ruby hash (with symbol keys). Accepts a boolean argument, representing whether or not to deep-serialize nestedAuthor
andCategory
objects (defaults tofalse
).as_json
: Serialize into a Ruby hash which is also a valid JSON hash.to_json
: Serialize into a valid JSON string.ATTRIBUTES
constant forPaper
,Author
andCategory
entities, as a list of which attributes are available for the entity.