Class: Cure::Dsl::Transformations::Candidate
- Inherits:
-
Object
- Object
- Cure::Dsl::Transformations::Candidate
- Defined in:
- lib/cure/dsl/transformations.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#named_range ⇒ Object
readonly
Returns the value of attribute named_range.
-
#no_match_translation ⇒ Object
readonly
Returns the value of attribute no_match_translation.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#translations ⇒ Object
readonly
Returns the value of attribute translations.
Instance Method Summary collapse
- #if_no_match(&block) ⇒ Object
-
#initialize(column, named_range:, ref: "_default") ⇒ Candidate
constructor
A new instance of Candidate.
- #with_translation(&block) ⇒ Object
Constructor Details
#initialize(column, named_range:, ref: "_default") ⇒ Candidate
Returns a new instance of Candidate.
36 37 38 39 40 41 42 43 |
# File 'lib/cure/dsl/transformations.rb', line 36 def initialize(column, named_range:, ref: "_default") @column = column @named_range = named_range @ref = ref @translations = [] @no_match_translation = nil end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
34 35 36 |
# File 'lib/cure/dsl/transformations.rb', line 34 def column @column end |
#named_range ⇒ Object (readonly)
Returns the value of attribute named_range.
34 35 36 |
# File 'lib/cure/dsl/transformations.rb', line 34 def named_range @named_range end |
#no_match_translation ⇒ Object (readonly)
Returns the value of attribute no_match_translation.
34 35 36 |
# File 'lib/cure/dsl/transformations.rb', line 34 def no_match_translation @no_match_translation end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
34 35 36 |
# File 'lib/cure/dsl/transformations.rb', line 34 def ref @ref end |
#translations ⇒ Object (readonly)
Returns the value of attribute translations.
34 35 36 |
# File 'lib/cure/dsl/transformations.rb', line 34 def translations @translations end |
Instance Method Details
#if_no_match(&block) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/cure/dsl/transformations.rb', line 55 def if_no_match(&block) no_match_translation = Translation.new no_match_translation.instance_exec(&block) @no_match_translation = Transformation::Translation.new( no_match_translation.strategy, no_match_translation.generator ) end |
#with_translation(&block) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/cure/dsl/transformations.rb', line 45 def with_translation(&block) translation = Translation.new translation.instance_exec(&block) @translations << Transformation::Translation.new( translation.strategy, translation.generator ) end |