lib/hqmf-parser/converter/pass1/simple_precondition.rb in hqmf-parser-1.0.6 vs lib/hqmf-parser/converter/pass1/simple_precondition.rb in hqmf-parser-1.1.0

- old
+ new

@@ -9,11 +9,11 @@ attr_accessor :klass, :processed, :subset_comparison def initialize(id, preconditions,reference,conjunction_code,negation) super(id, preconditions,reference,conjunction_code,negation) - @id = @@ids.next if (@id.nil?) + @id = HQMF::Counter.instance.next if (@id.nil?) @klass = PRECONDITION end def to_json json = super @@ -42,21 +42,9 @@ def delete_converted_restrictions! preconditions.delete_if {|precondition| precondition.restriction? and precondition.converted} end - # Simple class to issue monotonically increasing integer identifiers - class Counter - def initialize - @count = 0 - end - - def next - @count+=1 - end - end - @@ids = Counter.new - end end end \ No newline at end of file