@@ -50,8 +50,6 @@ Resources must be derived from `JSONAPI::Resource`, or a class that is itself de
5050For example:
5151
5252``` ruby
53- require ' jsonapi/resource'
54-
5553class ContactResource < JSONAPI ::Resource
5654end
5755```
@@ -64,8 +62,6 @@ the `attribute` method, and multiple attributes can be declared with the `attrib
6462For example:
6563
6664``` ruby
67- require ' jsonapi/resource'
68-
6965class ContactResource < JSONAPI ::Resource
7066 attribute :name_first
7167 attributes :name_last , :email , :twitter
@@ -81,8 +77,6 @@ This allows a resource's methods to access the underlying model.
8177For example, a computed attribute for ` full_name ` could be defined as such:
8278
8379``` ruby
84- require ' jsonapi/resource'
85-
8680class ContactResource < JSONAPI ::Resource
8781 attributes :name_first , :name_last , :email , :twitter
8882 attribute :full_name
@@ -127,8 +121,6 @@ the `update` or `create` methods, override the `self.updatable_fields` and `self
127121This example prevents ` full_name ` from being set:
128122
129123``` ruby
130- require ' jsonapi/resource'
131-
132124class ContactResource < JSONAPI ::Resource
133125 attributes :name_first , :name_last , :full_name
134126
@@ -280,8 +272,6 @@ declared using the `filter` method, and multiple filters can be declared with th
280272For example:
281273
282274``` ruby
283- require ' jsonapi/resource'
284-
285275class ContactResource < JSONAPI ::Resource
286276 attributes :name_first , :name_last , :email , :twitter
287277
@@ -762,7 +752,6 @@ The `ResourceSerializer` can be used to serialize a resource into JSON API compl
762752 method that takes a resource instance or array of resource instances to serialize. For example:
763753
764754``` ruby
765- require ' jsonapi/resource_serializer'
766755post = Post .find(1 )
767756JSONAPI ::ResourceSerializer .new (PostResource ).serialize_to_hash(PostResource .new (post))
768757```
0 commit comments