Sha256: 39cd9f9e3729da9ce6b0684f9fb344d76753825b571d6efcc6615b69c03d65a9
Contents?: true
Size: 1.14 KB
Versions: 67
Compression:
Stored size: 1.14 KB
Contents
module HQMF module Converter class SimplePrecondition < HQMF::Precondition COMPARISON = "COMPARISON" PRECONDITION = "PRECONDITION" attr_accessor :klass, :processed, :subset_comparison, :conjunction_code def initialize(id, preconditions,reference,conjunction_code,negation) super(id, preconditions,reference,conjunction_code,negation) @id = HQMF::Counter.instance.next if (@id.nil?) @klass = PRECONDITION end def to_json json = super # json[:klass] = @klass json end def comparison? @klass == COMPARISON end def restriction? false end def has_preconditions? preconditions and !preconditions.empty? end def restrictions preconditions.select {|precondition| precondition.restriction?} end def reference=(reference) @reference = reference end def delete_converted_restrictions! preconditions.delete_if {|precondition| precondition.restriction? and precondition.converted} end end end end
Version data entries
67 entries across 67 versions & 2 rubygems