Skip to content

Commit

Permalink
Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
styxit committed Aug 14, 2019
1 parent a879625 commit a1aba6d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion exonetapi/result/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, data):
def parse(self):
"""Parse JSON string into a Resource or a list of Resources.
:return: list|Resource: List with Resources or a single Resource.
:return list|Resource: List with Resources or a single Resource.
"""
if type(self.__json_data) is list:
resources = []
Expand Down
12 changes: 6 additions & 6 deletions exonetapi/structures/Relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class Relation(object):
def __init__(self, relation_name, origin_type, origin_id):
"""Relation constructor.
:param: str relation_name The name of the relation.
:param: str origin_type The resource type of the origin resource.
:param: str origin_id The resource ID of the origin resource.
:param str relation_name: The name of the relation.
:param str origin_type: The resource type of the origin resource.
:param str origin_id: The resource ID of the origin resource.
"""
self.__name = relation_name
self.__url = self.__urlPattern % (origin_type, origin_id, relation_name)
Expand All @@ -35,16 +35,16 @@ def get_resource_identifiers(self):
"""
Get the resource identifiers for this relation.
:return ApiResourceSet|ApiResourceIdentifier The resource identifier or a resource set.
:return ApiResourceSet|ApiResourceIdentifier: The resource identifier or a resource set.
"""
return self.__resourceIdentifiers

def set_resource_identifiers(self, new_relationship):
"""
Replace the related resource identifiers with new data.
:param ApiResourceSet|ApiResourceIdentifier new_relationship A new resource identifier or a new resource set.
:return self
:param ApiResourceSet|ApiResourceIdentifier new_relationship: A new resource identifier or a new resource set.
:return self:
"""
self.__resourceIdentifiers = new_relationship

Expand Down
1 change: 0 additions & 1 deletion exonetapi/structures/Resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ def to_json_resource_identifier(self):

return super().to_json()


4 changes: 2 additions & 2 deletions exonetapi/structures/ResourceIdentifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def related(self, name):
:param name: The name of the relation.
:return: Relation The new relation.
:return Relation: The new relation.
"""
return Relation(name, self.type(), self.id())

Expand All @@ -46,7 +46,7 @@ def relationship(self, name, *data):
:param name: The name of the relation to set.
:param data: The value of the relation, can be a Resource or a dict of Resources.
:return: self when setting a relationship, or the actual relationship when getting it
:return self: when setting a relationship, or the actual relationship when getting it
"""
if len(data) is 1:
return self.set_relationship(name, data[0])
Expand Down

0 comments on commit a1aba6d

Please sign in to comment.