Class: Stupidedi::Builder::IdentifierStack::HL
- Inherits:
-
Object
- Object
- Stupidedi::Builder::IdentifierStack::HL
- Defined in:
- lib/stupidedi/builder/identifier_stack.rb
Instance Attribute Summary collapse
-
#sequence ⇒ Object
writeonly
Sets the attribute sequence.
Instance Method Summary collapse
- #hl ⇒ Object
- #id ⇒ Object
-
#initialize(parent, id) ⇒ HL
constructor
A new instance of HL.
-
#parent ⇒ Object
Parent HL number.
- #pop ⇒ Object
Constructor Details
#initialize(parent, id) ⇒ HL
Returns a new instance of HL.
143 144 145 |
# File 'lib/stupidedi/builder/identifier_stack.rb', line 143 def initialize(parent, id) @parent, @id, @sequence = parent, id, id end |
Instance Attribute Details
#sequence=(value) ⇒ Object (writeonly)
Sets the attribute sequence
141 142 143 |
# File 'lib/stupidedi/builder/identifier_stack.rb', line 141 def sequence=(value) @sequence = value end |
Instance Method Details
#hl ⇒ Object
147 148 149 |
# File 'lib/stupidedi/builder/identifier_stack.rb', line 147 def hl HL.new(self, @sequence += 1) end |
#id ⇒ Object
151 152 153 |
# File 'lib/stupidedi/builder/identifier_stack.rb', line 151 def id @id.to_s end |
#parent ⇒ Object
Parent HL number
156 157 158 159 160 161 |
# File 'lib/stupidedi/builder/identifier_stack.rb', line 156 def parent case @parent when HL @parent.id end end |
#pop ⇒ Object
163 164 165 166 |
# File 'lib/stupidedi/builder/identifier_stack.rb', line 163 def pop @parent.sequence = @sequence @parent end |