Skip to content

Commit

Permalink
Merge pull request #2 from atatabitovska/patch-4
Browse files Browse the repository at this point in the history
Update class-methods.rst
  • Loading branch information
OrestisKan committed Mar 20, 2022
2 parents 2589484 + 308029a commit 9e0c4f7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/topics/class-methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ The ``from_settings`` class method is implemented in the following objects:
Implementing Factory Methods
============================

While extending a class that implements one of these factory methods.
One's goal when extending these factory methods is simply given the arguments passed to it,
whether is crawler, settings or any additional ones; to create a class instance.
The main reason of including the Crawler object or the Settings object is because of the how much
The goal when extending these factory methods should be: given the arguments passed to it,
reate a class instance, regardless of it being a crawler, settings or other.
The main reason to include the Crawler object or the Settings object is the amount of
information these objects hold and can be used in the instantiation of the class.

``Crawler`` specifically gives access to ``settings``, ``signals``, ``stats``, ``extensions``,
``engine``, and ``spider`` which maybe very useful when wanting to instantiate a class.

For example, lets say that we want to create a new spider, say TestSpider will look like this::
For example, lets say that we want to create a new spider, TestSpider will look like this::

class TestSpider:
Expand Down

0 comments on commit 9e0c4f7

Please sign in to comment.