Class: Descriptor::MergePoint::List

Inherits:
Object
  • Object
show all
Defined in:
lib/rui/descriptor.rb

Instance Method Summary collapse

Constructor Details

#initializeList

Returns a new instance of List.



173
174
175
# File 'lib/rui/descriptor.rb', line 173

def initialize
  @mps = []
end

Instance Method Details

#add(mp) ⇒ Object



181
182
183
# File 'lib/rui/descriptor.rb', line 181

def add(mp)
  @mps << mp
end

#firstObject



177
178
179
# File 'lib/rui/descriptor.rb', line 177

def first
  @mps.first
end

#step!Object



185
186
187
188
189
190
191
192
# File 'lib/rui/descriptor.rb', line 185

def step!
  raise "Stepping invalid merge point list" if @mps.empty?
  @mps.each do |mp|
    mp.position += 1
  end
  @mps.first.count -= 1
  clean!
end