Class: ActiveFacts::CQL::Compiler::CompilationContext
- Inherits:
-
Object
- Object
- ActiveFacts::CQL::Compiler::CompilationContext
- Defined in:
- lib/activefacts/cql/compiler/shared.rb
Instance Attribute Summary collapse
-
#allowed_forward_terms ⇒ Object
Returns the value of attribute allowed_forward_terms.
-
#bindings ⇒ Object
readonly
The Bindings in this declaration.
-
#player_by_role_name ⇒ Object
readonly
Returns the value of attribute player_by_role_name.
Instance Method Summary collapse
-
#concept(name) ⇒ Object
Look up this concept by its name.
-
#initialize(vocabulary) ⇒ CompilationContext
constructor
A new instance of CompilationContext.
Constructor Details
#initialize(vocabulary) ⇒ CompilationContext
Returns a new instance of CompilationContext.
45 46 47 48 49 50 51 |
# File 'lib/activefacts/cql/compiler/shared.rb', line 45 def initialize vocabulary @vocabulary = vocabulary @vocabulary_identifier = @vocabulary. @allowed_forward_terms = [] @bindings = {} @player_by_role_name = {} end |
Instance Attribute Details
#allowed_forward_terms ⇒ Object
Returns the value of attribute allowed_forward_terms.
41 42 43 |
# File 'lib/activefacts/cql/compiler/shared.rb', line 41 def allowed_forward_terms @allowed_forward_terms end |
#bindings ⇒ Object (readonly)
The Bindings in this declaration
42 43 44 |
# File 'lib/activefacts/cql/compiler/shared.rb', line 42 def bindings @bindings end |
#player_by_role_name ⇒ Object (readonly)
Returns the value of attribute player_by_role_name.
43 44 45 |
# File 'lib/activefacts/cql/compiler/shared.rb', line 43 def player_by_role_name @player_by_role_name end |
Instance Method Details
#concept(name) ⇒ Object
Look up this concept by its name
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/activefacts/cql/compiler/shared.rb', line 54 def concept(name) constellation = @vocabulary.constellation player = constellation.Concept[[@vocabulary_identifier, name]] # Bind to an existing role which has a role name (that's why we bind those first) player ||= @player_by_role_name[name] if !player && @allowed_forward_terms.include?(name) player = constellation.EntityType(@vocabulary, name) end player end |