Skip to content

Commit c912827

Browse files
committed
Remove unrequired require statements
1 parent 1d4572d commit c912827

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ Resources must be derived from `JSONAPI::Resource`, or a class that is itself de
5050
For example:
5151

5252
```ruby
53-
require 'jsonapi/resource'
54-
5553
class ContactResource < JSONAPI::Resource
5654
end
5755
```
@@ -64,8 +62,6 @@ the `attribute` method, and multiple attributes can be declared with the `attrib
6462
For example:
6563

6664
```ruby
67-
require 'jsonapi/resource'
68-
6965
class 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.
8177
For example, a computed attribute for `full_name` could be defined as such:
8278

8379
```ruby
84-
require 'jsonapi/resource'
85-
8680
class 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
127121
This example prevents `full_name` from being set:
128122

129123
```ruby
130-
require 'jsonapi/resource'
131-
132124
class 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
280272
For example:
281273

282274
```ruby
283-
require 'jsonapi/resource'
284-
285275
class 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'
766755
post = Post.find(1)
767756
JSONAPI::ResourceSerializer.new(PostResource).serialize_to_hash(PostResource.new(post))
768757
```

0 commit comments

Comments
 (0)