Class: SimpleXml::ParsedPrecondition
- Inherits:
-
Object
- Object
- SimpleXml::ParsedPrecondition
- Defined in:
- lib/model/precondition.rb
Instance Attribute Summary collapse
-
#conjunction_code ⇒ Object
Returns the value of attribute conjunction_code.
-
#id ⇒ Object
Returns the value of attribute id.
-
#negation ⇒ Object
Returns the value of attribute negation.
-
#preconditions ⇒ Object
Returns the value of attribute preconditions.
-
#reference ⇒ Object
Returns the value of attribute reference.
Instance Method Summary collapse
-
#handle_negations(parent) ⇒ Object
negations already handled since parsed prconditions came from handling the parent’s negations…
-
#initialize(id, preconditions, reference, conjunction_code, negation) ⇒ ParsedPrecondition
constructor
A new instance of ParsedPrecondition.
- #to_model ⇒ Object
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_code ⇒ Object
Returns the value of attribute conjunction_code.
366 367 368 |
# File 'lib/model/precondition.rb', line 366 def conjunction_code @conjunction_code end |
#id ⇒ Object
Returns the value of attribute id.
366 367 368 |
# File 'lib/model/precondition.rb', line 366 def id @id end |
#negation ⇒ Object
Returns the value of attribute negation.
366 367 368 |
# File 'lib/model/precondition.rb', line 366 def negation @negation end |
#preconditions ⇒ Object
Returns the value of attribute preconditions.
366 367 368 |
# File 'lib/model/precondition.rb', line 366 def preconditions @preconditions end |
#reference ⇒ Object
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_model ⇒ Object
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 |