|
6 | 6 |
|
7 | 7 |
|
8 | 8 | class Reference: |
9 | | - """ https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 """ |
| 9 | + """https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03""" |
10 | 10 |
|
11 | 11 | def __init__(self, reference: str, parent: str = None): |
12 | 12 | self._ref = reference |
@@ -40,29 +40,29 @@ def pointer(self) -> Pointer: |
40 | 40 | return Pointer(frag) |
41 | 41 |
|
42 | 42 | def is_relative(self) -> bool: |
43 | | - """ return True if reference path is a relative path """ |
| 43 | + """return True if reference path is a relative path""" |
44 | 44 | return not self.is_absolute() |
45 | 45 |
|
46 | 46 | def is_absolute(self) -> bool: |
47 | | - """ return True is reference path is an absolute path """ |
| 47 | + """return True is reference path is an absolute path""" |
48 | 48 | return self._parsed_ref.netloc != "" |
49 | 49 |
|
50 | 50 | @property |
51 | 51 | def value(self) -> str: |
52 | 52 | return self._ref |
53 | 53 |
|
54 | 54 | def is_url(self) -> bool: |
55 | | - """ return True if the reference path is pointing to an external url location """ |
| 55 | + """return True if the reference path is pointing to an external url location""" |
56 | 56 | return self.is_remote() and self._parsed_ref.netloc != "" |
57 | 57 |
|
58 | 58 | def is_remote(self) -> bool: |
59 | | - """ return True if the reference pointer is pointing to a remote document """ |
| 59 | + """return True if the reference pointer is pointing to a remote document""" |
60 | 60 | return not self.is_local() |
61 | 61 |
|
62 | 62 | def is_local(self) -> bool: |
63 | | - """ return True if the reference pointer is pointing to the current document """ |
| 63 | + """return True if the reference pointer is pointing to the current document""" |
64 | 64 | return self._parsed_ref.path == "" |
65 | 65 |
|
66 | 66 | def is_full_document(self) -> bool: |
67 | | - """ return True if the reference pointer is pointing to the whole document content """ |
| 67 | + """return True if the reference pointer is pointing to the whole document content""" |
68 | 68 | return self.pointer.parent is None |
0 commit comments