Completed
Pull Request — master (#17)
by
unknown
01:20
created

sdoc.sdoc2.node.ReferenceNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %
Metric Value
dl 0
loc 50
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A is_block_command() 0 7 1
A is_inline_command() 0 7 1
A get_command() 0 7 1
A __init__() 0 8 1
A is_phrasing() 0 7 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from sdoc.sdoc2 import node_store
10
from sdoc.sdoc2.node.Node import Node
11
12
13
class ReferenceNode(Node):
14
    """
15
    SDoc2 node for references.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19
    def __init__(self, options, argument):
20
        """
21
        Object constructor.
22
23
        :param dict[str,str] options: The options of this reference.
24
        :param str argument: The title of this reference.
25
        """
26
        super().__init__('ref', options, argument)
27
28
    # ------------------------------------------------------------------------------------------------------------------
29
    def get_command(self):
30
        """
31
        Returns the command of this node, i.e. reference.
32
33
        :rtype: str
34
        """
35
        return 'ref'
36
37
    # ------------------------------------------------------------------------------------------------------------------
38
    def is_block_command(self):
39
        """
40
        Returns False.
41
42
        :rtype: bool
43
        """
44
        return False
45
46
    # ------------------------------------------------------------------------------------------------------------------
47
    def is_inline_command(self):
48
        """
49
        Returns True.
50
51
        :rtype: bool
52
        """
53
        return True
54
55
    # ------------------------------------------------------------------------------------------------------------------
56
    def is_phrasing(self):
57
        """
58
        Returns True.
59
60
        :rtype: bool
61
        """
62
        return True
63
64
# ----------------------------------------------------------------------------------------------------------------------
65
node_store.register_inline_command('ref', ReferenceNode)
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...