Class: ActiveFacts::CQL::Compiler::SimpleMatching

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(targ_term_list, transform_expr) ⇒ SimpleMatching

Returns a new instance of SimpleMatching.



88
89
90
91
# File 'lib/activefacts/cql/compiler/transform_rule.rb', line 88

def initialize targ_term_list, transform_expr
  @targ_term_list = targ_term_list
  @transform_expr = transform_expr
end

Instance Attribute Details

#targ_term_listObject

Returns the value of attribute targ_term_list.



86
87
88
# File 'lib/activefacts/cql/compiler/transform_rule.rb', line 86

def targ_term_list
  @targ_term_list
end

#transform_exprObject

Returns the value of attribute transform_expr.



86
87
88
# File 'lib/activefacts/cql/compiler/transform_rule.rb', line 86

def transform_expr
  @transform_expr
end

Instance Method Details

#compile(context) ⇒ Object



93
94
95
96
97
98
99
100
101
102
# File 'lib/activefacts/cql/compiler/transform_rule.rb', line 93

def compile(context)
  vocabulary_identifier = context.vocabulary.identifying_role_values
  constellation = context.vocabulary.constellation

  expr = transform_expr ? transform_expr.compile(context) : nil
  simple_rule = constellation.SimpleMatching(:new, :expression => expr)
  ActiveFacts::CQL::Compiler.build_transform_target_refs(context, @targ_term_list, simple_rule)

  simple_rule
end