Class: Stupidedi::Parser::IdentifierStack::GS

Inherits:
Object
  • Object
show all
Defined in:
lib/stupidedi/parser/identifier_stack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, sequence) ⇒ GS

Returns a new instance of GS.



140
141
142
# File 'lib/stupidedi/parser/identifier_stack.rb', line 140

def initialize(parent, sequence)
  @count, @parent, @sequence, @id = 0, parent, sequence, sequence.value
end

Instance Attribute Details

#id (readonly)

Returns the value of attribute id.



138
139
140
# File 'lib/stupidedi/parser/identifier_stack.rb', line 138

def id
  @id
end

Instance Method Details

#countInteger

Number of Transaction Sets Included (GE01)

Returns:

  • (Integer)


152
153
154
# File 'lib/stupidedi/parser/identifier_stack.rb', line 152

def count
  @count
end

#pop



160
161
162
163
# File 'lib/stupidedi/parser/identifier_stack.rb', line 160

def pop
  warn "DEPRECATION WARNING: IdentifierStack#pop is deprecated, use pop_gs (when removing an GS identifier from the stack)"
  pop_gs
end

#pop_gs



156
157
158
# File 'lib/stupidedi/parser/identifier_stack.rb', line 156

def pop_gs
  @parent
end

#st(start = nil)



144
145
146
147
# File 'lib/stupidedi/parser/identifier_stack.rb', line 144

def st(start = nil)
  sequence = start.try{|n| Sequence.new(n) } || @sequence
  ST.new(self, sequence).tap { @count += 1; sequence.succ! }
end