Class: ActiveFacts::CQL::Compiler::Vocabulary

Inherits:
Definition
  • Object
show all
Defined in:
lib/activefacts/cql/compiler/shared.rb

Instance Attribute Summary

Attributes inherited from Definition

#constellation, #tree, #vocabulary

Instance Method Summary collapse

Methods inherited from Definition

#all_bindings_in_clauses, #build_all_steps, #build_step, #build_variables, #source

Constructor Details

#initialize(name, is_transform, version_number) ⇒ Vocabulary

Returns a new instance of Vocabulary.



114
115
116
117
118
# File 'lib/activefacts/cql/compiler/shared.rb', line 114

def initialize name, is_transform, version_number
  @name = name
  @is_transform = is_transform
  @version_number = version_number
end

Instance Method Details

#compileObject



120
121
122
123
124
125
126
# File 'lib/activefacts/cql/compiler/shared.rb', line 120

def compile
  if @constellation.Vocabulary.size > 0
    @constellation.Topic @name
  else
    @constellation.Vocabulary(@name, is_transform: @is_transform, version_number: @version_number)
  end
end

#to_sObject



128
129
130
# File 'lib/activefacts/cql/compiler/shared.rb', line 128

def to_s
  @name
end