Class: Stupidedi::Versions::Common::SyntaxNotes::C
Overview
Conditional: if the first element specified in the condition is
present, then all other elements must be specified.
Instance Attribute Summary
#indexes
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #satisfied?
Class Method Details
.build(*args)
159
160
161
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 159
def build(*args)
new(args)
end
|
Instance Method Details
#forbidden(zipper)
104
105
106
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 104
def forbidden(zipper)
[]
end
|
#reason(zipper)
108
109
110
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 108
def reason(zipper)
"elements #{indexes.tail.join(", ")} must be present when element #{indexes.head} is present"
end
|
#required(zipper)
92
93
94
95
96
97
98
99
100
101
102
|
# File 'lib/stupidedi/versions/common/syntax_notes.rb', line 92
def required(zipper)
if zipper.child(indexes.head - 1).node.present?
children(zipper).tail
else
[]
end
end
|