Class: ActiveFacts::CQL::Compiler::ReadingMatchSideEffect

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

Overview

An instance of ReadingMatchSideEffects is created when the compiler matches an existing fact type. It captures the details that have to be adjusted for the match to be regarded a success.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(phrase, role_ref, num, absorbed_precursors, absorbed_followers, common_supertype, residual_adjectives) ⇒ ReadingMatchSideEffect

Returns a new instance of ReadingMatchSideEffect.



604
605
606
607
608
609
610
611
612
# File 'lib/activefacts/cql/compiler/reading.rb', line 604

def initialize phrase, role_ref, num, absorbed_precursors, absorbed_followers, common_supertype, residual_adjectives
  @phrase = phrase
  @role_ref = role_ref
  @num = num
  @absorbed_precursors = absorbed_precursors
  @absorbed_followers = absorbed_followers
  @common_supertype = common_supertype
  @residual_adjectives = residual_adjectives
end

Instance Attribute Details

#absorbed_followersObject (readonly)

Returns the value of attribute absorbed_followers.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def absorbed_followers
  @absorbed_followers
end

#absorbed_precursorsObject (readonly)

Returns the value of attribute absorbed_precursors.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def absorbed_precursors
  @absorbed_precursors
end

#common_supertypeObject (readonly)

Returns the value of attribute common_supertype.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def common_supertype
  @common_supertype
end

#numObject (readonly)

Returns the value of attribute num.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def num
  @num
end

#phraseObject (readonly)

Returns the value of attribute phrase.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def phrase
  @phrase
end

#residual_adjectivesObject (readonly)

Returns the value of attribute residual_adjectives.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def residual_adjectives
  @residual_adjectives
end

#role_refObject (readonly)

Returns the value of attribute role_ref.



602
603
604
# File 'lib/activefacts/cql/compiler/reading.rb', line 602

def role_ref
  @role_ref
end

Instance Method Details

#costObject



614
615
616
# File 'lib/activefacts/cql/compiler/reading.rb', line 614

def cost
  absorbed_precursors + absorbed_followers + (common_supertype ? 1 : 0)
end