Class: SimpleXml::ParsedPrecondition

Inherits:
Object
  • Object
show all
Defined in:
lib/model/precondition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, preconditions, reference, conjunction_code, negation) ⇒ ParsedPrecondition

Returns a new instance of ParsedPrecondition.



367
368
369
370
371
372
373
# File 'lib/model/precondition.rb', line 367

def initialize(id, preconditions, reference, conjunction_code, negation)
  @id = id
  @preconditions = preconditions
  @reference = reference
  @conjunction_code = conjunction_code
  @negation = negation
end

Instance Attribute Details

#conjunction_codeObject

Returns the value of attribute conjunction_code.



366
367
368
# File 'lib/model/precondition.rb', line 366

def conjunction_code
  @conjunction_code
end

#idObject

Returns the value of attribute id.



366
367
368
# File 'lib/model/precondition.rb', line 366

def id
  @id
end

#negationObject

Returns the value of attribute negation.



366
367
368
# File 'lib/model/precondition.rb', line 366

def negation
  @negation
end

#preconditionsObject

Returns the value of attribute preconditions.



366
367
368
# File 'lib/model/precondition.rb', line 366

def preconditions
  @preconditions
end

#referenceObject

Returns the value of attribute reference.



366
367
368
# File 'lib/model/precondition.rb', line 366

def reference
  @reference
end

Instance Method Details

#handle_negations(parent) ⇒ Object

negations already handled since parsed prconditions came from handling the parent’s negations… just continue



375
376
377
378
379
# File 'lib/model/precondition.rb', line 375

def handle_negations(parent)
  @preconditions.each do |p|
    p.handle_negations(self)
  end
end

#to_modelObject



380
381
382
383
384
# File 'lib/model/precondition.rb', line 380

def to_model
  pcs = preconditions.collect {|p| p.to_model}
  mr = reference ? reference.to_model : nil
  HQMF::Precondition.new(id, pcs, mr, conjunction_code, negation)
end