@@ -53,7 +53,7 @@ Example:
5353class DeserializablePost < JSONAPI ::Deserializable ::Post
5454 # ...
5555 type do |t |
56- field primary_type: t.capitalize
56+ { primary_type: t.capitalize }
5757 end
5858end
5959```
@@ -68,7 +68,7 @@ Example:
6868class DeserializablePost < JSONAPI ::Deserializable ::Post
6969 # ...
7070 id do |i |
71- field primary_id: i.to_i
71+ { primary_id: i.to_i }
7272 end
7373end
7474```
@@ -86,7 +86,7 @@ Example:
8686class DeserializablePost < JSONAPI ::Deserializable ::Post
8787 # ...
8888 attribute :date do |d |
89- field created_at: d
89+ { created_at: d }
9090 end
9191end
9292```
@@ -110,9 +110,9 @@ Example:
110110class DeserializablePost < JSONAPI ::Deserializable ::Post
111111 # ...
112112 has_many :comments do |rel , ids , types |
113- field comment_ids: ids
114- field comment_types: types.map(& :capitalize )
115- field comment_meta: rel[' meta' ]
113+ { comment_ids: ids,
114+ comment_types: types.map(& :capitalize ),
115+ comment_meta: rel[' meta' ] }
116116 end
117117end
118118```
@@ -131,9 +131,9 @@ Example:
131131class DeserializablePost < JSONAPI ::Deserializable ::Post
132132 # ...
133133 has_one :author do |rel , id , type |
134- field author_id: id
135- field author_type: type.capitalize
136- field author_meta: rel[' meta' ]
134+ { author_id: id,
135+ author_type: type.capitalize,
136+ author_meta: rel[' meta' ] }
137137 end
138138end
139139```
0 commit comments