Class: ActiveFacts::CQL::Compiler::ContextNote
- Inherits:
-
Object
- Object
- ActiveFacts::CQL::Compiler::ContextNote
- Defined in:
- lib/activefacts/cql/compiler/constraint.rb
Instance Attribute Summary collapse
-
#agreed_agents ⇒ Object
readonly
Returns the value of attribute agreed_agents.
-
#agreed_date ⇒ Object
readonly
Returns the value of attribute agreed_date.
-
#context_kind ⇒ Object
readonly
Returns the value of attribute context_kind.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#who ⇒ Object
readonly
Returns the value of attribute who.
Instance Method Summary collapse
- #compile(constellation, target) ⇒ Object
-
#initialize(context_kind, description, who, agreed) ⇒ ContextNote
constructor
A new instance of ContextNote.
Constructor Details
#initialize(context_kind, description, who, agreed) ⇒ ContextNote
Returns a new instance of ContextNote.
19 20 21 22 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 19 def initialize context_kind, description, who, agreed @context_kind, @description, @who, @agreed = context_kind, description, who, agreed @agreed_date, @agreed_agents = *agreed end |
Instance Attribute Details
#agreed_agents ⇒ Object (readonly)
Returns the value of attribute agreed_agents.
17 18 19 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 17 def agreed_agents @agreed_agents end |
#agreed_date ⇒ Object (readonly)
Returns the value of attribute agreed_date.
17 18 19 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 17 def agreed_date @agreed_date end |
#context_kind ⇒ Object (readonly)
Returns the value of attribute context_kind.
17 18 19 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 17 def context_kind @context_kind end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
17 18 19 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 17 def description @description end |
#who ⇒ Object (readonly)
Returns the value of attribute who.
17 18 19 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 17 def who @who end |
Instance Method Details
#compile(constellation, target) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/activefacts/cql/compiler/constraint.rb', line 24 def compile constellation, target context_note = constellation.ContextNote( :new, :context_note_kind => @context_kind, :description => @description ) context_note.relevant_concept = target.concept if @agreed_date || @agreed_agents agreement = constellation.Agreement(context_note) agreement.date = @agreed_date if @agreed_date @agreed_agents.each do |agent| constellation.ContextAgreedBy(agreement, agent) end end if @who && @who.size > 0 @who.each do |agent| constellation.ContextAccordingTo(context_note, agent) end end context_note end |