Class: Stupidedi::Versions::Common::SyntaxNotes::E
Overview
Exclusion: not more than one of the elements in the condition may
be present
Instance Attribute Summary
#indexes
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #satisfied?
Class Method Details
.build(*args)
153
154
155
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 153
def build(*args)
new(args)
end
|
Instance Method Details
#forbidden(zipper)
72
73
74
75
76
77
78
79
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 72
def forbidden(zipper)
xs = children(zipper)
xs.count{|x| x.node.present? } <= 1 ? [] : xs
end
|
#reason(zipper)
81
82
83
84
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 81
def reason(zipper)
present = indexes.select{|n| zipper.child(n - 1).node.present? }
"only one of elements #{present.join(", ")} may be present"
end
|
#required(zipper)
68
69
70
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 68
def required(zipper)
[]
end
|