Class: Level
- Inherits:
-
EADElement
- Object
- EADElement
- Level
- Defined in:
- lib/elements/c.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #__parent=(parent) ⇒ Object
- #description_level ⇒ Object
-
#initialize ⇒ Level
constructor
A new instance of Level.
- #set_numbered ⇒ Object
- #set_unnumbered ⇒ Object
- #unnumbered? ⇒ Boolean
Constructor Details
#initialize ⇒ Level
Returns a new instance of Level.
19 20 21 |
# File 'lib/elements/c.rb', line 19 def initialize @unnumbered = false end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
12 13 14 |
# File 'lib/elements/c.rb', line 12 def parent @parent end |
Instance Method Details
#__parent=(parent) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/elements/c.rb', line 38 def __parent=(parent) super if parent.unnumbered? self.set_unnumbered end end |
#description_level ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/elements/c.rb', line 45 def description_level if __parent return __parent.description_level + 1 else return 0 end end |
#set_numbered ⇒ Object
27 28 29 |
# File 'lib/elements/c.rb', line 27 def set_numbered @unnumbered = false end |
#set_unnumbered ⇒ Object
23 24 25 |
# File 'lib/elements/c.rb', line 23 def set_unnumbered @unnumbered = true end |
#unnumbered? ⇒ Boolean
31 32 33 34 35 36 |
# File 'lib/elements/c.rb', line 31 def unnumbered? if not instance_variables.index('@unnumbered') @unnumbered = false end @unnumbered end |